COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: laxmanrao83 on 20 Aug 2009 07:15:17 AM

Title: How to count the -ve values .
Post by: laxmanrao83 on 20 Aug 2009 07:15:17 AM
Hi All,

How to count the -ve values .
ex:
i have gross profit column.in that i have -ve values.
i want to count that -ve values

Thanks in Advance
Laxman
Title: Re: How to count the -ve values .
Post by: uttam.mistry on 20 Aug 2009 02:10:31 PM
count(if gross profit < 0.00 then 1 else null)
or
sum(if gross profit < 0.00 then 1 else 0)
Title: Re: How to count the -ve values .
Post by: rama83 on 31 Aug 2009 01:35:36 AM
Hi,

Try this way

if(gross-profit<0)  then (count(gross_profit)) else (null)