COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: learnflower on 30 Nov 2011 03:24:15 AM

Title: Calculation based 2 condition
Post by: learnflower on 30 Nov 2011 03:24:15 AM
Hi ,

I am facing problem to do a sum of particular column based on 2 condition
eg:

Sum( [Booked Premiums transactions]  for [Business]='Direct' and [Business_segment]='Hull Blue Water')

I need to know how can i calculate  based on the 2 conditions [Business]='Direct' and [Business_segment]='Hull Blue .

By using the above eg i am getting error , please guide me how to proceed on this.
Title: Re: Calculation based 2 condition
Post by: blom0344 on 30 Nov 2011 03:28:28 AM
total(
case
when
([Business]='Direct' and [Business_segment]='Hull Blue Water')
then
[Booked Premiums transactions]
else (0)
end)
Title: Re: Calculation based 2 condition
Post by: learnflower on 30 Nov 2011 06:00:11 AM
Thanks Blom its working :)