Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine >  Web analytics View modes: 
User avatar
Member
Member
mehrdadilchizadeh-gmail - 9/1/2013 7:13:43 AM
   
Web analytics
i have problem in my Web analytics


ReportTable.ascx] Error loading the data: [DataConnection.HandleError]: Query: DECLARE @PaveViews TABLE ( DocumentNamePath NVARCHAR(500), ObjectID INT, Pageviews INT, Percents DECIMAL(10,2), Average INT ) DECLARE @Sum DECIMAL; SET @FromDate =dbo.Func_Analytics_DateTrim(@FromDate,'week'); SET @ToDate =dbo.Func_Analytics_EndDateTrim(@ToDate,'week'); SELECT @Sum = SUM(HitsCount) FROM Analytics_Statistics INNER JOIN Analytics_WeekHits ON Analytics_WeekHits.HitsStatisticsID = Analytics_Statistics.StatisticsID LEFT JOIN View_CMS_Tree_Joined ON View_CMS_Tree_Joined.NodeID = Analytics_Statistics.StatisticsObjectID AND StatisticsObjectCulture = DocumentCulture WHERE (StatisticsSiteID = @CMSContextCurrentSiteID) AND (StatisticsCode=@CodeName) AND (HitsStartTime >= @FromDate) AND (HitsEndTime <= @ToDate) INSERT INTO @PaveViews (DocumentNamePath,objectID,pageViews,percents) SELECT TOP 100 CASE WHEN DocumentNamePath LIKE '' OR DocumentNamePath IS NULL THEN StatisticsObjectName ELSE DocumentNamePath END , StatisticsObjectID, SUM(HitsCount), (SUM(HitsCount)/@Sum)*100 FROM Analytics_Statistics INNER JOIN Analytics_WeekHits ON Analytics_WeekHits.HitsStatisticsID = Analytics_Statistics.StatisticsID LEFT JOIN View_CMS_Tree_Joined ON Analytics_Statistics.StatisticsObjectID = View_CMS_Tree_Joined.NodeID AND StatisticsObjectCulture = DocumentCulture WHERE (StatisticsSiteID = @CMSContextCurrentSiteID) AND (HitsStartTime >= @FromDate) AND (HitsEndTime <= @ToDate) AND (StatisticsCode=@CodeName) GROUP BY DocumentNamePath, StatisticsObjectName,StatisticsObjectID ORDER BY SUM(HitsCount) DESC UPDATE @PaveViews SET Average = (SELECT SUM(HitsValue)/SUM(HitsCount) FROM Analytics_WeekHits JOIN Analytics_Statistics ON HitsStatisticsID = StatisticsID WHERE HitsStartTime >= @FromDate AND HitsEndTime <= @ToDate AND StatisticsObjectID = objectID AND StatisticsCode ='avgtimeonpage' AND StatisticsSiteID = @CMSContextCurrentSiteID ) SELECT DocumentNamePath AS 'Page',pageviews AS 'Views', CAST (Percents AS NVARCHAR(10))+'%' AS 'Percentage', ISNULL(CONVERT(varchar, DATEADD(s, average, 0), 108),'00:00:00') AS 'Average time on page' FROM @PaveViews ORDER BY PageViews DESC: caused exception: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.Func_Analytics_DateTrim", or the name is ambiguous

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 9/1/2013 6:16:18 PM
   
RE: Web analytics
Hi Mehrdad,

Can you check the function dbo.Func_Analytics_DateTrim exists in:

{Your database} -> Programmability -> Functions -> Scalar-valued Functions

Regards,

Josef Dvorak