COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: Bobnos on 11 Feb 2011 08:40:26 AM

Title: Conditional Formatting of Percentages
Post by: Bobnos on 11 Feb 2011 08:40:26 AM
Hey - I have 4 pairs of 2 fields (eight fields) that I need to compare against each other, and if they're different values, they should display in red, versus if they're the same they should be green.

It works like a dream for normal integer values like 240 worked hours or 5 full-time employees.  However, when comparing percentages (i.e. Percentage of overtime to total hours), it's showing every value green.  I have the exact same conditional formatting formula in for the 2 percentage fields that I do for the integer fields - works for the integers, not the percentages.

Can anyone help? My thought was that it was seeing every percentage as a 0 (since they're all less than 1) so it was treating them all as if they were zeros...

I'd appreciate any feedback, thanks.

-Bobnos
Title: Re: Conditional Formatting of Percentages
Post by: MFGF on 11 Feb 2011 10:00:39 AM
Hi,

Values displayed as percentages are normally held as decimals.  So, for example, if you have a value showing as 67%, it will actually be stored as 0.67.  Your conditional ranges will need to take this into account (so instead of 20 to 40, you would use 0.2 to 0.4).

Regards,

MF.
Title: Re: Conditional Formatting of Percentages
Post by: Bobnos on 11 Feb 2011 10:29:20 AM
Thanks for the response.

I can't seem to find conditional ranges.. can you point me in the right direction?

Title: Re: Conditional Formatting of Percentages
Post by: MFGF on 11 Feb 2011 12:45:25 PM
Just use the same mechanism you are currently using (most likely in a string variable I would imagine?) but instead of using 20 and 40 in your expression, use 0.2 and 0.4 (for example).

Regards,

MF.