Hello all (i'm back :)),
I'm still using TM1 Cube as source.
I have one question:
I have prompt with YearMonth : 201202,201203...
If the user choose 201202 I need to divide un column by 2, If the user choose 201306, I need to divide by 6 (Eg i need to divide by the month number)
But 201203 is not number.
The fact is that I can't get the month in number in order to divide the column.
Does it possible ? Could someone help me ?
Thank you so much,
Guicore
Is the user entering the value 201202 or is he selecting 201202 from a value prompt?
If he's selecting the member from a value prompt, and if your hierarchy is set up as Year --> Quarter --> Month (or Year --> Month) then you can try the following:
[Measure] / count(1 within set periodsToDate([Cube].[Time Dimension].[Time Hierarchy].[Year Level],#prompt('YearMonth','mun')#))
The user selects the month, the periodsToDate generates a set of all the months leading up to the selected month, which is counted with the count function. So if the user selects 201202, it will resolve as:
[Measure] / count(1 within set set(201201,201202))
[Measure] / 2
Thank you Paul.
It works perfectly.
GuiCoRe