COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cbyrne on 19 Jul 2011 05:13:47 AM

Title: Condition for when two outputted numbers dont match highlight Red
Post by: cbyrne on 19 Jul 2011 05:13:47 AM
Hello does anyone now of a variable condition for when two outputted data items don't match then highlight in Red.

Basically i have two data items, estimated quantity and actual quantity so when these don't match i want to highlight the field red.

I have created conditions in the past for when greater than a quantity but never to match one data to another.

Many Thanks

Chris
Title: Re: Condition for when two outputted numbers dont match highlight Red
Post by: rockytopmark on 19 Jul 2011 11:32:01 AM
1). Create a Boolean Variable, named v_Estimate_NE_Actual
2). Expression: [estimated quantity] <> [actual quantity]
3). Assign the cell's Conditional Variable to use v_Estimate_NE_Actual variable
4). Set the Variable to "Yes" using the Condition Explorer
5). Set the properties of the Cell as desired, to "highlight" in Red

HTH... M
Title: Re: Condition for when two outputted numbers dont match highlight Red
Post by: Lynn on 19 Jul 2011 11:52:52 AM
Another option is to use a conditional style rather than a style variable:

1) Click on the thing to be highlighted and select the conditional style property
2) Select Advanced Conditional Style from the "New" icon
3) Name the style e.g., Estimate <> New
4) Create a new Advanced expression: [estimated quantity] <> [actual quantity]
5) Click the pencil icon to edit the style for the expression just created to show red highlighting

I kind of like conditional styles better than style variables. Just seems more intuitive to me somehow. You can also search for things that have a conditional style from the Edit > Find menu. Otherwise I think it is essentially 6 of one, half dozen of the other.
Title: Re: Condition for when two outputted numbers dont match highlight Red
Post by: cbyrne on 19 Jul 2011 03:32:42 PM
OMG you guys are awesome this worked a treat, so simple and i have been trying all day.


Thank you both


Chris