Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Analysis Services 2005 MDX: Year End calculation

Status
Not open for further replies.

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.



 
Hi again,

I'm not sure if my previous message didn't make sense to anyone as I haven't had any responses. So to put it simply I would like to know what the MDX would be to get the YTD amount for December without having to hardcode a specific year and month.

Any help would be much appreciated!
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top