0
votes

My SSAS cube uses currency conversion intelligence which will show some measures calculated from currency rates. However, in Date hierarchy dimension, I need to add more MDX to make my own Date hierarchy to show correct summation as follows.

> // Scope for sum [Calendar year - month - date].[Month] SCOPE
> ([Date].[Calendar year - month - date].[Month].MEMBERS,
> {[Measures].[Revenue],  Measures.[Sales]});
>     THIS = Sum( EXISTING [Date].[Calendar year - month - date].CurrentMember.Children ,[Measures].CurrentMember); END SCOPE;
> 
> // Scope for sum [Calendar year - month - date].[Calendar year] SCOPE
> ([Date].[ Calendar year - month - date].[Calendar year].MEMBERS, 
> {[Measures].[Revenue],  Measures.[Sales]});
>     THIS = Sum( EXISTING [Date].[Calendar year - month - date].CurrentMember.Children ,[Measures].CurrentMember); END SCOPE;

This works just fine on Month and Calendar Year level. However, when looking at the grand total in Excel, it always shows sum of all years. When I change the filter to select only 2 years, it still shows sum all years in grand totals.

1
That's because [Date].[Calendar year - month - date].CurrentMember is [Date].[Calendar year - month - date].[All]. What's the purpose of this scope?Danylo Korostil
Thanks for your answer. The scope is for MDX currency calculation logic that it should work for [Calendar year - month - date] hierarchy as well. Then, if I don't want [Date].[Calendar year - month - date].[All], how can I specify currentmember for selected Calendar year?JJ0022
I think this is a scope for grand total , but still my script sums up all years. SCOPE ([Date].[Calendar year - month - date], {[Measures].[Revenue], Measures.[Sales]}); THIS = Sum( EXISTING [Date].[Calendar year - month - date]. [Dep calendar year].CurrentMember ,[Measures].CurrentMember); END SCOPE;JJ0022
I still have no clue. Is there any different between total value and sum of its children? What is it?Danylo Korostil
Hi, my problem is that how can I write MDX to sum only selected values.. for the scope above.. For example, if I have year 2015 to 2019, and I select only year 2015 and 2016, I'd like grand total to show sum of year 2016+2016. However, instead SUM Existing with currentmember only show sum of all years...JJ0022

1 Answers

0
votes

No MDX needed. You have to toggle VisualTotals checkbox in Excel: http://cloud.addictivetips.com/wp-content/uploads/2009/11/PivotTableVisualStyle.jpg