MDX : YTD of the previous year on a specific hierarchy

This formula can avoid the hour spent to Search for it! This one directly calculate the aggregated members.

aggregate

({

openingperiod([Date].[Calendar Soc].[Day],ancestor([Date].[Calendar Soc].CurrentMember,[Date].[Calendar Soc].[Year Soc]).prevmember)

:

ClosingPeriod( [Date].[Calendar Soc].[Day],cousin([Date].[Calendar Soc].CurrentMember,ancestor([Date].[Calendar Soc].CurrentMember,[Date].[Calendar Soc].[Year Soc]).prevmember))

},[Measures].[…])

Advertisements