COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 18 Jun 2016 09:49:25 AM

Title: Same Query Item but Different Conditions
Post by: gosoccer on 18 Jun 2016 09:49:25 AM
Hi Folks, :) :)

the following is not working when I need to roll up the Numbers to Total. Pls see  below code,
In the Data Item, as an Expression, I have the following,

Expression: (Works)
CARX_COUNT

if ( [ID Report].[Rpt_Data].[CAR_TYP_CD] in_range
{'10':'20'} 
then (1)
else (0)

Now, I have a secondary Data Item that is setup based on the following,
Data Item: Expression
Expression: CARX_COUNT (From above)
Aggregation Func. Calculated
Roll up Aggregation Fund: Total
Detail: Automatic
Calc Intesect: Show Value


So, I was hoping that when I drop this Data Item as a part of my List, it'll total up
all the counts but it's not.

Any help would be great.

Thx :) :)
Title: Re: Same Query Item but Different Conditions
Post by: HalfBloodPrince on 20 Jun 2016 01:35:44 AM
Try this

total(if ( [ID Report].[Rpt_Data].[CAR_TYP_CD] in_range
{'10':'20'} 
then (1)
else (0) )
Title: Re: Same Query Item but Different Conditions
Post by: hespora on 20 Jun 2016 05:31:18 AM
Quote from: gosoccer on 18 Jun 2016 09:49:25 AM
Aggregation Func. Calculated
Roll up Aggregation Fund: Total

Just set those to total and none, respectively.