Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Last Year using Scope or Calculated Member - Rollup issue or Grand Total issue

$
0
0
Hi Folks, I'm getting stuck with the calculation of the last year using MDX. First I create a calculated member and the scope it like this:[code="other"]CREATE MEMBER CURRENTCUBE.[Measures].[Sales Discount LY] AS NULL; SCOPE([Measures].[Sales Discount LY], [Time].[Date].Members); this = (Cousin ( [Time].[Year - Quarter - Month - Date].CurrentMember ,Ancestor ( [Time].[Year - Quarter - Month - Date].CurrentMember ,[Time].[Year - Quarter - Month - Date].[Year] ).Lag(1) ),[Measures].[Sales Discount]); -- Overwrite for weeks SCOPE([Measures].[Sales Discount LY], [Time].[Year - Week - Date].[Week].Members); this = (Cousin ( [Time].[Year - Week - Date].CurrentMember ,Ancestor ( [Time].[Year - Week - Date].CurrentMember ,[Time].[Year - Week - Date].[Year] ).Lag(1) ),[Measures].[Sales Discount]); END SCOPE; END SCOPE; [/code]That works fine except that the grand total is not shown. Therefore I followed some suggestions and created a dummy named column and a real measure, then I overwrote the measure using the scope above and commented out the calculated member. Now I have the grand total, but the problem is some aggragations are not correct: [img]http://social.msdn.microsoft.com/Forums/getfile/486338[/img]just to add more confusion, it only happens with one year. What could be wrong? Any comment would be appreciated Kind Regards,

Viewing all articles
Browse latest Browse all 1341

Trending Articles