Assume you have a date attributes in the following format:
[Date].[Calendar Date].[Year].&[1999].&[1].&[1].&[01/16/1999]
First create a named set [Current month], with below script. Then followed by Last 6 Months and parallel period.
Current Month:
StrToMember('[Date].[Calendar Date].[Date].&[' + FORMAT(Now(), "MM/dd/yyyy") + ']').Parent
Last 6 Months:
TAIL({NULL: [Current Month].ITEM(0)}, 6)
Last 6 Months - Previous Year
TAIL({NULL: PARALLELPERIOD([Date].[Calendar Date].[Year], 1, [Current Month].ITEM(0))}, 6)
No comments:
Post a Comment