COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ankurmittal on 06 May 2013 01:02:38 PM

Title: Divide crosstab fact cell with an integer
Post by: ankurmittal on 06 May 2013 01:02:38 PM
Hi,

I have  a requirement wherein I have to divide crosstab fact cells of different columns with different numbers.
For example: Say a crosstab with row as R1 & columns as C1,C2,C3 with default measure M; now I want to display crosstab as folows:

--> intersection[R1,C1] as (M/n1)

--> intersection[R1,C2] as (M/n2)

--> intersection[R1,C3] as (M/n3)

Is it possible to achieve?
Title: Re: Divide crosstab fact cell with an integer
Post by: blom0344 on 07 May 2013 11:59:20 AM
It is simply a matter of replacing the dataitem containing M with a CASE:

CASE
WHEN [COLITEM] = 'C1' THEN M/n1
WHEN [COLITEM] = 'C2' THEN M/n2
WHEN [COLITEM] = 'C3' THEN M/n3
ELSE 0
END