If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Calculation with prompt result

Started by GuiCoRe, 11 Apr 2013 02:08:05 AM

Previous topic - Next topic

GuiCoRe

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

CognosPaul

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

GuiCoRe

Thank you Paul.

It works perfectly.

GuiCoRe