COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sg@sfwater on 12 Jul 2016 01:35:49 PM

Title: Coditional formatting
Post by: sg@sfwater on 12 Jul 2016 01:35:49 PM
I am trying to apply advanced conditional formatting using Cognos 10.  I have the following, which works well with only one variable (temperature)

Case [Query1].[ANALYTE]
When 'Temperature (°F)' then if [Query1].[VALUE] >68 then 1 else 0
End

but I want to change it to include temperature and location, and shade the cell if the values is not between 60 and 68.  Basically, if the temperature at Location A is not between 60 and 68, shade the cell.  Can anyone help?

Thanks--SG@sfwater
Title: Re: Coditional formatting
Post by: sdf on 12 Jul 2016 08:47:48 PM
suppose you are working with a list.
you can create a boolean variable [Query1].[VALUE] between 60 and 68.
then select the column you want to apply the condition to, and set the style variable with the boolean you just created.
hover over condition explorer and select YES. Then change the background color for the column.

Title: Re: Coditional formatting
Post by: sg@sfwater on 13 Jul 2016 10:15:05 AM
Thanks SDF but I need to define the the conditional formatting as being dependent upon two variable.  Temperature and location.  While I have no problem with one variable (temperature), I'm having trouble adding location to the expression.
Title: Re: Coditional formatting
Post by: cognos-t on 14 Jul 2016 02:13:43 AM
Hi,

please try the following syntax:

IF([Query1].[ANALYTE] = 'Temperature (°F)' and [Query1].[VALUE] >68) THEN (1) ELSE (0)

Best regards