Hi,
Current date function exists in MDX,its called Now()
Unfortunately this function is not supported By SAP whereas it is by Microsoft.
MDX expression for rolling periods can be expressed like this:
[0CALDAY].currentmember.lag(13)
: Return the current day in the 0CALDAY characteristic minus 13 days.
You can do the same with year, quarter, month or week:
[0CALYEAR].currentmember.lag(13)
[0CALQUARTER.currentmember.lag(13)
[0CALMONTH].currentmember.lag(13)
[0CALWEEK].currentmember.lag(13)
To compute rolling periods you need expressions like YTD (Year to date), QTD, MTD, WTD like this:
SUM(YTD([0CALDAY].currentmember.lag(13)), [Measures].[measure_definition])
To have dynamic expression you can replace the number of periods (13 in the sample below) by a prompt expression like this:
SUM(YTD([0CALDAY].currentmember.lag(@Prompt('Enter number of periods','N',,,))), [Measures].[measure_definition])
Regards
Didier
Add comment