COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: HERRERA on 01 Aug 2013 01:08:13 PM

Title: TM1 Reports using Case statement
Post by: HERRERA on 01 Aug 2013 01:08:13 PM
 Hello all !!!

I have a TM1 cube and i need make a simple report...

I need to create a data item with Case function. I know its easy, but i cant  :(

When i use transformer cube, i have no problem, but the same statement in TM1 cube, i get an error message.

Does anyone know if tm1 cube does not support the function CASE ??

Tks for help !

Hugs from Brasil !
Herrera

Title: Re: TM1 Reports using Case statement
Post by: CognosPaul on 01 Aug 2013 01:28:39 PM
In general no form of OLAP supports case. Depending on what you were doing with the Power Cubes, you may have been forcing Cognos to use local processing.

What are you trying to achieve?
Title: Re: TM1 Reports using Case statement
Post by: HERRERA on 01 Aug 2013 01:41:06 PM
Hi Paul.

Paul, i understand, but i always use this type of data item. The query is simple, take a look:

Case ?measures?
When 'sales' Then [CUBE].[XXX].[NET_SALES]
When 'revenue' Then [CUBE].[XXX].[TOTAL_REVENUE]
End

I want to make a dynamic prompt with some measures, using static choices.

Title: Re: TM1 Reports using Case statement
Post by: CognosPaul on 01 Aug 2013 02:19:04 PM
Define your prompt as follows:


Display  |  Use
---------+-------------------------
sales    | [CUBE].[XXX].[NET_SALES]
revenue  | [CUBE].[XXX].[TOTAL_REVENUE]




And the data item as
#prompt('measures','token','[CUBE].[XXX].[NET_SALES]')#

No case needed.
Title: Re: TM1 Reports using Case statement
Post by: HERRERA on 01 Aug 2013 02:50:23 PM
Ok Paul, but i have more than one measure. In  this case, how can i create the data item ?

Can i use a statement twice in the same data item ?

For example:

#prompt('measures','token','[CUBE].[XXX].[NET_SALES]')#
#prompt('measures','token','[CUBE].[XXX].[TOTAL_REVENUE]')#

Its correct ?

Tks for help !!!!
Title: Re: TM1 Reports using Case statement
Post by: CognosPaul on 01 Aug 2013 03:38:36 PM
It's not a case statement. With the path of the measure as the USE value in the prompt, it's actually setting that expression to the measure you want. The third parameter of the prompt function is simply the default value. So if nothing is passed to the measures parameter, it will default to showing NET_SALES.
Title: Re: TM1 Reports using Case statement
Post by: HERRERA on 02 Aug 2013 07:53:50 AM
Paul, thanks a lot !!!!!

Its working !!!!

Hugs from Brazil.

Herrera