COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: barrysaab on 22 Sep 2014 08:05:48 AM

Title: How to compare data items
Post by: barrysaab on 22 Sep 2014 08:05:48 AM
Hi Folks,I have two data items namely Type and Amount,In Type there are type1 and type 2 so on,I need to compare

type=1 total amount > type=2 total amount,How to do this,thanks in advance.
Title: Re: How to compare data items
Post by: BigChris on 23 Sep 2014 08:02:08 AM
Would something like this work:

total(if([Type] = 'Type 1') then ([Amount]) else (0)) > total(if[Type] = 'Type 2') then ([Amount]) else (0))

You might need to play around with before or after aggregation...but it might work.
Title: Re: How to compare data items
Post by: barrysaab on 04 Oct 2014 05:03:27 AM
Thanks BigChris,It did worked.Apologies for delayed response.