COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Peewee71 on 11 Feb 2009 11:20:37 AM

Title: conditional total function
Post by: Peewee71 on 11 Feb 2009 11:20:37 AM
I  have the following expression within report studio  which works fine.

total([ColA] for [TEAM] )

However, i now need to expand that expression to total values only where ColB is equal to the value 1.
I tried using:
total([ColA] for [TEAM] , [ColB]=1)
Unfortunately this does not work.  What do i need to change the expression to, so that it achieves this?

any ideas?
Title: Re: conditional total function
Post by: blom0344 on 11 Feb 2009 01:51:44 PM
CASE WHEN
([ColB]=1)
THEN
(total([ColA] for [TEAM] ))
ELSE
(0)
END