Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set colour for different values(thresolds) in Cognos 8 1

Status
Not open for further replies.

jsudha1984

Programmer
Jun 22, 2009
17
0
0
US
Hi All,

I am using Cognos for reporting of Network performance. I want to have certain things in reports. Such as i have to set the colour to a thresold value of nodes availability. My requirement is when nodes utilization crosses 80%,in the report the availibity coloum for that node has to show value with red colour or only red colour,likewise if it crosses 60% it has to show Yellow colour etc. Is it possible through Cognos 8?
 
Yes, this is possible by using a variable (conditional formatting) or the combination of an image/report expression

using a variable:

1. Drag a string variable from condition explorer and define a case like:

CASE
WHEN [DATAITEM] > 0.80 THEN 'RED'
WHEN [DATAITEM] > 0.60 THEN 'YELLOW'
WHEN [DATAITEM] > 0.20 THEN 'GREEN'
ELSE 'WHITE'
END

2. Create 4 values 'RED','YELLOW','GREEN','WHITE' for the variable

3. Choose the column in the report for conditional formatting and define the style variable.

4. Assign proper colors from condition explorer (Cognos shows an additional value)

Ties Blom

 
Thanks blom0344..............

I went through the steps you provided and i did from 1 to 3. The step number 4, i dont know where i can assign proper colors from condition explorer and where it shows an additional value

I am trying all these in Report studio.
 
Select the column and then open up condition explorer. Navigate (- can be tricky) to the variable and choose the value you want to assign. Then navigate to the left and select background color in property panel. Set this to a standard color or assign a colorcode.

[Navigating in condition explorer can be tricky as it often closes when navigating]

Ties Blom

 
Ties Blom,

I did all the steps as you mentioned, but still i can't see the expected result..
 
Are you using a list? What are the expressions of the dataitem and the variable?

Ties Blom

 
Yes i am using List in Report Studio.
The expression i used is like WHEN [Utilization] > 0.80 THEN 'RED'
I am using string variable
 
Blom,

I did as following In the report Studio

1.I went to Condition Explorer,right clicked on variable,chose new string variable,Named as String1,clicked on Add icon,put this condition
if ([Availability]<1) then ('RED') else ('GREEN')
2.Clicked on ok,ok. Then i got Expression Definition page automatically,so there i put same condition then clicked OK
3.I went Source(main) window, i selected Availibilty column,then i went properties panel and selected Style Variable,chose new string variable,named as string1 and put same condition as earlier one then ok.
4.Then went colour and background(in properties),selected Background color and chose Red, then ran the report
5.In the report the title Availibilty has become red colour. But the values are in default colour. Means no change

I doubt in steps 3 and 4 above. In third step, i dont know what have to select,because if i select a coloumn and put style variable, that title will become red and it doesn't obey the condition
and 2nd doubt with step 4, where i have to assign proper colors to Green, Red etc as we defined in the condition. Is it with Colour and Background under properties tab?

Please correct me if i did it wrong


Waiting for your reply

 
You only have to define the CASE expression once in the variable. When you use a string variable, then you NEED to create values in condition explorer.

In case you have the expression:

CASE
WHEN [DATAITEM] > 0.80 THEN 'RED'
WHEN [DATAITEM] > 0.60 THEN 'YELLOW'
WHEN [DATAITEM] > 0.20 THEN 'GREEN'
ELSE 'WHITE'
END

you need to create the values RED,YELLOW,GREEN,WHITE.

After setting the style variable for the column , select the column and then open condition explorer.
Navigate to value 'RED'. Select this (bar becomes green) and then point the mouse to the property panel for setting the background color.

(Setting conditional properties is only active when the vertical condition explorer bar becomes fully green)

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top