Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How can I get the TOP articles statistics for a specific node View modes: 
User avatar
Certified Developer 8
Certified Developer 8
liquidmagic - 5/13/2011 3:23:28 PM
   
How can I get the TOP articles statistics for a specific node
Hello,

I was to create a repeater with a custom query that will return the top articles (based on impressions) for a specific node.

Normally, I would use something like this for top articles from every part of the site:
SELECT DocumentNamePath, NodeName, NodeAliasPath, articleTitle, datestamp, smallDescription, SUM(HitsCount) FROM
Analytics_Statistics, Analytics_DayHits, View_SDay_Articles_Joined
WHERE (StatisticsSiteID = 1) AND (StatisticsCode='pageviews') AND
(StatisticsID = HitsStatisticsID) AND (StatisticsObjectID = NodeID)
AND (StatisticsObjectCulture = DocumentCulture)
AND (HitsStartTime >= DATEADD(dd,-1, GETDATE()))

GROUP BY DocumentNamePath, NodeName, NodeAliasPath, articleTitle, datestamp, smallDescription
ORDER BY SUM(HitsCount) DESC

But what about a node. So, if I have an article under the node Products and I have the repeater on this page I want to have the top articles under Products.

Any idea/would be appreciated.

Dimitris

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/18/2011 7:07:41 AM
   
RE:How can I get the TOP articles statistics for a specific node
Hello,


just for other visitors:

You could use the Where condition to restrict the documents. For example:

WHERE NodeAliasPath LIKE '{%NodeAliasPath%}/%'


Best regards,
Helena Grulichova