COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: V i n c e n t on 04 Nov 2010 12:23:37 PM

Title: Need help with case when in olap package
Post by: V i n c e n t on 04 Nov 2010 12:23:37 PM
Hi,

Sorry for my bad english.

I need your help with case when in olap package

When im using a rolap package and i want to make a new value, i can do this :
CASE
When [COUNTRY]='USA' THEN '01'
When [COUNTRY]='FRANCE' THEN '02'
ELSE 'OTHERS'
END

If i make a list with this value and quantity i have the sum of quantity for each 01, 02 and 'others'
It's fine !

But if i do the same thing in olap package (cube) the result is wrong.
I have only on value for 01, 02 and 'others' not the sum. (probably the last value)

How can i do to have the same résult like rolap ?

Thanks for your help.
Title: Re: Need help with case when in olap package
Post by: MFGF on 05 Nov 2010 04:58:05 AM
Hi Vincent,

How is this being used?  Is it to generate row/column values in a crosstab (or chart)?

If so, just drag in the first two members from the package tree (USA and France), and add a query calculation for the Others with the following expression:

aggregate(currentMeasure within set except([Your Country Level],set([USA member],[France member])))

Regards,

MF.
Title: Re: Need help with case when in olap package
Post by: V i n c e n t on 05 Nov 2010 10:57:04 AM
Thanks for your help.

I solve my problem more simply.
I made à new value with the mesure i need and change the aggregate function to sum.

Vince.