COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: Garima on 21 Jun 2007 04:40:10 AM

Title: Negative numbers
Post by: Garima on 21 Jun 2007 04:40:10 AM
Hi..
In my list report there are around 50 columns which contain numeric data.I was looking for a way to highlight negative numbers red!!Though conditional variables can be used...but is there some generic method that I can use for all the columns instead of using 50 conditional variables!!!
Is there a way to achieve this in cognos 8??
Thanks,
Garima
Title: Re: Negative numbers
Post by: Desperado on 21 Jun 2007 08:20:55 AM
There is one ......
Create 1 conditional variable. (say Var_Xyz)
copy the report.xml to some editingtool (Edit Plus).
search for this conditional variable (Var_Xyz)
now, copy it and paste it in a new sheet . (As u need 50 variables, just have 50 (Var_Xyz) on the same sheet)
now, you can rename the remaining 49 with the new variable names and the column names. once after this is done copy the entire sheet, and paste it in the same place in report.xml.

this will work.
Title: Re: Negative numbers
Post by: Garima on 21 Jun 2007 11:54:56 PM
Thank you so much... :) I think its a very nice method and will save us a lot of time.
But I was wondering if there is some kind of workaround so that just one variable can be used for the entire list body i.e on all the columns...or some sort of data formatting that we can apply so that negative numbers get highlighted.
Title: Re: Negative numbers
Post by: goose on 22 Jun 2007 05:50:54 AM
only the negetive sign symbol via data formatting.
Title: Re: Negative numbers
Post by: Garima on 22 Jun 2007 06:49:38 AM
The negative sign symbol is not the concern I need to change the colour if the values are negative........
I can do this using conditional variables but am looking for some way so that I donot have to use so many conditional variable....(as the number of columns are around 50)!!!

For eg.If we select few columns and apply the percent data format to it and also specify that the symbol should be % then all the values in the selected columns get the symbol % ...similarly am trying to find a way out such that the colour of the negative numbers could be changed to something that we specify eg.red.
Title: Re: Negative numbers
Post by: goose on 22 Jun 2007 02:30:53 PM
Sorry Garima what I meant was there is nothing you can do that I know of in Cognos like want you want. Your best bet would to use negetive symbol sign but thats obviosuly not what you want..... I am interested how you fit 50 columns on one page or are you using A3 paper?
Title: Re: Negative numbers
Post by: larsonr on 25 Jun 2007 08:59:40 PM
We asked Cognos about that during the first release of Cognos 8.  Coming from a PowerPlay background this should have been a no brainer to include.  When we asked Cognos, they said they would log it for an enhancement.  3 releases later, still no sign of it coming any time soon.
Title: Re: Negative numbers
Post by: roadwarrior on 26 Jun 2007 03:10:42 PM
Or, create a single boolean variable like the following:
(C1<0 or C2<0 or C3<0 or C4<0 or ... or C50<0)
Assign the same style variable to all columns.
Apply style (red font) for the correct Yes/No value of the variable.
This approach will only execute a single variable rather than 50 variables.
Not sure if it will be any more or less efficient to execute at report run time, but it should be far easier to implement at report design time than creating/maintaining 50 variables.