COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: tupac_rd on 01 Jun 2010 10:08:50 AM

Title: negatives as zeroes
Post by: tupac_rd on 01 Jun 2010 10:08:50 AM
Hi Gurus,

How do we display negative numbers as zeroes in Report Studio report.

Thanks
2pac
Title: Re: negatives as zeroes
Post by: tupac_rd on 01 Jun 2010 10:45:08 AM
that was easy, I was having issues because I a using Lotus notes db, and the numbers are stored as text, and if I do a cast(integer) was not working... so I instead said if ([d1] starts with '-') then ('0') else ([d1])
Title: Re: negatives as zeroes
Post by: mvjcognos on 14 Jul 2010 02:42:36 AM
case when (quatity<0) then (0) else (quantity)
Title: Re: negatives as zeroes
Post by: tupac_rd on 14 Jul 2010 02:04:27 PM
Sorry, the data is stored as text, and '<' is not working....
Title: Re: negatives as zeroes
Post by: mvjcognos on 16 Jul 2010 03:00:37 AM
try with boolean or string variable

case when quantity='zeros' then ('0') else quantity end

then click on the column assign the variable ........