Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryExtending the Repository with Attribute StatisticsExtending the Repository with Attribute Statistics
Previous
 
Next
New Post
8/11/2006 7:10 PM
 

If you are using the Attributes feature of the Repository module and your Repository is get sizeable it might be useful to display some statistics on those attributes.

Anyway here is how I extended the Repository Module with Statistics for Attributes:

1. Create a Stored Procedure to display the statistics for one Attribute

CREATE PROCEDURE dbo.grmGetAttributeStatistics
(
        @AttributeName nvarchar(50)
)
AS
BEGIN

 DECLARE @xTotalObjects int

 SELECT @xTotalObjects = count(*) FROM dbo.grmRepositoryObjects

 SELECT [AttributeValues].[ValueName] as AttributeValue,
   count([ObjectValues].[ObjectID]) as AttributeCount,
   count([ObjectValues].[ObjectID]) * 100 / @xTotalObjects as Percentage

 FROM
  dbo.grmRepositoryAttributes as Attributes,
  dbo.grmRepositoryAttributeValues as AttributeValues,
  dbo.grmRepositoryObjectValues as ObjectValues

 WHERE
  [Attributes].[AttributeName] = @AttributeName and
  [Attributes].[ItemID] = [AttributeValues].[AttributeID] and
  [AttributeValues].[ItemID] = [ObjectValues].[ValueID]

 GROUP BY
  [AttributeValues].[ValueName]

 ORDER BY
  AttributeCount DESC

END
GO

2. Execute this procedure with the name of one of your attributes.

Query:

exec dbo.grmGetAttributeStatistics @AttributeName = 'Modules'

3. Format the Result to your liking. I was using the ListX module from www.bi4ce.com
and this is my setup for the formatting of the results in the ListX module:

Header Group:
<table width=100% >
<tr bgcolor= #5ebeff ><td>Website Location</td><td align=center>websites</td><td align=right> %</td></tr>

Footer Group:
</table>

Detail Item:
<tr>
 <td>[AttributeValue]</td><td align=center>[AttributeCount]</td><td align=right >[Percentage] %</td>
</tr>

Alternate Item:
<tr bgcolor=#c0c0c0 >
 <td>[AttributeValue]</td><td align=center>[AttributeCount]</td><td align=right >[Percentage] %</td>
</tr>

The results can be seen on this Fun with DNN Statistics page for the DotNetNuke Websites Directory

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryExtending the Repository with Attribute StatisticsExtending the Repository with Attribute Statistics


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out