Hi,
I' m trying to calculate ytd and the prior date to it using a selceted month as start month.
- start month:
prevmember([COPA_CD_article].[year_quarter_month].[year_quarter_month].[month] -> ?Start Month?)
- Previous month :
periodsToDate ([COPA_CD_article].[year_quarter_month].[year_quarter_month].[year (all)];[Start Month])
To show later months then start month:
except ([ Months_of_the_prompts_year];[Previous Month])
Due to the complexed time structure we have :year_quarter_month I have to create tow further prompts:
- Selection_Year: parent (parent ([Start Month]))
- Months_of_the_prompts_year: descendants ([Selection_Year];2)
This works fine for the selected year but how to do to get the prior period?
Thanks in advance!
You're trying to get the prior year to date?
To find the YTD for the previous year, you just need to use parallelPeriod on the start month to go back a year:
periodsToDate([COPA_CD_article].[year_quarter_month].[year_quarter_month].[year (all)]; parallelPeriod([Selection_Year];-1;[start month]))
thanks for the feedback,
It still doesnt work. It comes up with "LEVEL" error!!??
Whoops. Try:
periodsToDate([COPA_CD_article].[year_quarter_month].[year_quarter_month].[year (all)]; parallelPeriod([COPA_CD_article].[year_quarter_month].[year_quarter_month].[year (all)];-1;[start month]))