COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosun on 10 Jul 2013 12:57:21 PM

Title: negative values in brackets
Post by: cognosun on 10 Jul 2013 12:57:21 PM
I'm replacing negative sign (-) for negative numbers using abs()/absolute function.

For numbers <0 I'm applying red colour and for >0 I'm applying green colour.

Now, is there any way for me to show the negative-red values in brackets ( these don't have negative symbol anymore).

Title: Re: negative values in brackets
Post by: Lynn on 10 Jul 2013 01:14:38 PM
You can set the data format to number and then choose () in the "Negative Sign Symbol" property within the data format dialog.

Oh duh!! No, you can't do that because you have used the abs function!

Remove the abs function and then use the data format property.
Title: Re: negative values in brackets
Post by: cognosun on 11 Jul 2013 02:20:00 PM
I'm already showing negatives in red and positives in green.

Now I need to show negatives in brackets+ red ( post abs function usage)

:-)
Title: Re: negative values in brackets
Post by: Lynn on 11 Jul 2013 02:22:58 PM
How do you set the color to red based on < 0 if you do an abs function?
Title: Re: negative values in brackets
Post by: cognosun on 12 Jul 2013 12:45:04 PM


Like say...there is Column A  with value 1 and Column B with value 2, I used Column C for A-B, i.e. 1-2 = -1.

Now I used Column D with abs function i.e. abs(Column C), which gives me 1.

Then I used Conditional Style for colors, on Column D, by choosing it's source column as  Column C...and it worked.

:-)
Title: Re: negative values in brackets
Post by: Lynn on 12 Jul 2013 12:48:57 PM
I think you can get rid of column D altogether.

Change the number format of Column C to use () for negatives and set conditional style for column C based on column C.