COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 22 Aug 2014 07:12:47 AM

Title: Conditional Styling in Report 10.1.2 (OLAP)
Post by: gosoccer on 22 Aug 2014 07:12:47 AM
The client would like to see any values above 50 to show in Red as a part of the Crosstab I have established.
I have done the following but I'm getting an ugly error.

1) Establish the Conditional Style by using the Advanced option
2) Insert the following expression for checking in percentages and if any above 50, to highlight in Red.

But, unfortunately, I'm getting the following ugly error,

"The following expression is not valid: [Query4].[% (Total(# of Failure), (Total(# of Failure) + Total(# of Success)))] > 0. If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '0'. The variable named '[Query4].[% (Total(# of Failure), (Total(# of Failure) + Total(# of Success)))]' is invalid. "

So, I took care of this issue by making sure the data items are selected in the Property.

Well, now I'm getting another weird message!!
  The master-detail link is missing from the crosstab or chart.

I don't understand. I don't have two queries. Only one. 
Please help if you could. I very much appreciate your time.
Title: Re: Conditional Styling in Report 10.1.2 (OLAP)
Post by: gosoccer on 22 Aug 2014 12:10:57 PM
I'm getting closer!!! but stuck!!! ;D

I find-out what I need to assign the Conditional Styling. The problem is that once I go through the following steps,
Steps to Create a New Conditional Style
1. Click the object for which you want to define a conditional style, and then click the conditional styles button .
Tip: You can also right-click the object and click Style, Conditional Styles, or in the Properties pane, double-click the Conditional Styles property.
2. Click the add button and click New Conditional Style.
3. Select the data item that you want to use to determine the condition.On this step, I only see two of the Data Items from the Query3 but none of them
related to establishing a Query such as below,
([% (Total(# of Failure), (Total(# of Failure) + Total(# of Success)))] > 50
I basically need to have this Calculated Member from my Query3 to be used to
establish the logic for showing percentages above 50 in RED.
Title: Re: Conditional Styling in Report 10.1.2 (OLAP)
Post by: Lynn on 22 Aug 2014 12:53:47 PM
Is it the percentage you want to highlight shown in the crosstab and is that the item you want to shade red? If so, try an advanced conditional style with the expression:


cellValue() < 0.5
Title: Re: Conditional Styling in Report 10.1.2 (OLAP)
Post by: gosoccer on 22 Aug 2014 01:14:24 PM
YES, Getting some Red in the percentage column. The value of 3.75% is not getting red when I use the cellValue() > 1.0?
It is perhaps because it's using the actual decimal value?

Thx,
Title: RESOLVED: Conditional Styling in Report 10.1.2 (OLAP)
Post by: gosoccer on 22 Aug 2014 01:21:51 PM
YEAP! It is using the decimal values. So, thank you, thank you so much!!!  :) :) :o 8) Have a wonderful weekend!!