SSASUser
Programmer
- Dec 19, 2008
- 2
I’m having problems trying to get the YTD value for December only which needs to apply to all levels in the Calendar hierarchy.
My calculation for YTD uses the Time calculations concept for handling YTD, Prior Year etc.
-- YTD CALCULATIONS
([Time Calculations].[YTD]=
Aggregate(
CrossJoin({[Time Calculations].[Current Period]},
PeriodsToDate([Time].[Calendar Hierarchy].[Year],
[Time].[Calendar Hierarchy].CurrentMember)
)
)
);
The YTD calculation is correct.DecemberYTD works if I
hardcode it using the December 2008 member
-- December YTD CALCULATIONS
([Time Calculations].[DecYTD]=
([Time Calculations].[YTD],[Time].[Calendar Hierarchy].[Year].&[2008].&[Quarter 4].&[13]));
I’ve also tried this but it doesn’t apply the value to all levels of the hierarchy:
-- December YTD CALCULATIONS
Scope([Time].[Calendar Hierarchy].Members, [Time Calculations].[DecYTD], [Measures].[Amount]);
This =
([Time Calculations].[YTD], ClosingPeriod( [Time].[Calendar Hierarchy].[Year],[Time].[Calendar Hierarchy].CurrentMember));
End Scope;
Hope this makes sense.
Would anyone have a suggestion?
Thanks in advance.
My calculation for YTD uses the Time calculations concept for handling YTD, Prior Year etc.
-- YTD CALCULATIONS
([Time Calculations].[YTD]=
Aggregate(
CrossJoin({[Time Calculations].[Current Period]},
PeriodsToDate([Time].[Calendar Hierarchy].[Year],
[Time].[Calendar Hierarchy].CurrentMember)
)
)
);
The YTD calculation is correct.DecemberYTD works if I
hardcode it using the December 2008 member
-- December YTD CALCULATIONS
([Time Calculations].[DecYTD]=
([Time Calculations].[YTD],[Time].[Calendar Hierarchy].[Year].&[2008].&[Quarter 4].&[13]));
I’ve also tried this but it doesn’t apply the value to all levels of the hierarchy:
-- December YTD CALCULATIONS
Scope([Time].[Calendar Hierarchy].Members, [Time Calculations].[DecYTD], [Measures].[Amount]);
This =
([Time Calculations].[YTD], ClosingPeriod( [Time].[Calendar Hierarchy].[Year],[Time].[Calendar Hierarchy].CurrentMember));
End Scope;
Hope this makes sense.
Would anyone have a suggestion?
Thanks in advance.