COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: thart21 on 27 Apr 2012 07:49:18 AM

Title: Crosstab with multiple distinct measures
Post by: thart21 on 27 Apr 2012 07:49:18 AM
I posted this in the Cognos 10 section but posting it here in case there are users out there who don't look in the 10 forum.
Thanks!
I need to build a crosstab report and cannot seem to find anything similar to my situation.

                               
Rows                      Row Qtys      Addl measure
Confirmed                                      Confirmed $
Shipped                                         Shipped $
Received                                        Received $

Is there a way to define the "Addl measure" for each row? I am working on trying a calculated column with an "If" statement but running into validation errors with that.

Iif ([Confirmed Qty]>0 then [Query1].[Confirmed $] else if [Query1].[Shipped Qty]>0 then [Query1].[Shipped $], else if [Received Qty]>0 the [Query1].[Received $])     

Would appreciate any point in the right direction, thanks!
Title: Re: Crosstab with multiple distinct measures
Post by: MFGF on 30 Apr 2012 07:07:20 AM
I notice some parentheses are missing...

Does this work?:

if ([Confirmed Qty]>0) then ([Query1].[Confirmed $]) else if ([Query1].[Shipped Qty]>0) then ([Query1].[Shipped $]) else if ([Received Qty]>0) then ([Query1].[Received $])

I also spotted a spurious comma in the middle of the expression you posted, plus a missing 'n' from 'then', plus your expression used iif not if. Not sure whether these were just typing errors on the forum or whether your expression contained them too?

MF.
Title: Re: Crosstab with multiple distinct measures
Post by: thart21 on 02 May 2012 10:22:41 AM
Thanks MFGF, I will give it a try!