COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: yogeswari on 03 Feb 2015 06:37:30 AM

Title: Using Conditional Formatting
Post by: yogeswari on 03 Feb 2015 06:37:30 AM
Hi,

I have scenario like this:
I need to display blue color for max Revenue and red color for min Revenue by using condition formatting how it possible........?

Kindly let me know with the clear steps because i tried it out several ways for many hours  but i am unable to find out this.
Awaiting for your reply!!!!


Thanks.
Title: Re: Using Conditional Formatting
Post by: Robl on 03 Feb 2015 06:40:59 AM
You're going to need to explain things in a bit more detail.

Do you have a single column for revenue and you want to hightlight the value that's the lowest and the value that's the highest on the report.
Or is is the highest and lowest within a group or range?
Is it a list or a crosstab?

Either way, you need to create the data items to compare against.
So you'll need a revenue data item, a minimum revenue data item and a maximum revenue data item.
Try and create all of those first.

Title: Re: Using Conditional Formatting
Post by: mitali on 03 Feb 2015 06:44:16 AM
firstly create a data item which used to compare after that create string variable with max and min values,select revenue column and apply conditional formatting respective way.
Title: Re: Using Conditional Formatting
Post by: yogeswari on 05 Feb 2015 04:29:01 AM
Hi all,
thanks for your responses.
I am having a single column only.  I am using list.  I tried by creating maximum and minimum of revenue data items in both single query or separate query.  While i am using single query, it is showing error like "not a single-group group function".  If i use separate query, then in string variable, if i drag min and max item, it is also throwing error.

Also please be noted that i have tried all the said above ways / your possibilites before posting this query in this forum.  Can you please guide some other ways. I would consider your help and patience in this regard as Great. 

Thanks.
Title: Re: Using Conditional Formatting
Post by: MFGF on 05 Feb 2015 04:56:13 AM
Quote from: yogeswari on 05 Feb 2015 04:29:01 AM
Hi all,
thanks for your responses.
I am having a single column only.  I am using list.  I tried by creating maximum and minimum of revenue data items in both single query or separate query.  While i am using single query, it is showing error like "not a single-group group function".  If i use separate query, then in string variable, if i drag min and max item, it is also throwing error.

Also please be noted that i have tried all the said above ways / your possibilites before posting this query in this forum.  Can you please guide some other ways. I would consider your help and patience in this regard as Great. 

Thanks.

Hi,

You haven't told us what expression you are using to calculate your maximum and minimum revenue items. I just put together a simple example and it works fine for me.

I used the sample GO Sales (query) package, and built a list report with Product Line and Revenue as columns

I went to the query and added a query calculation called maxRev with the expression
maximum(total([Revenue] for [Product line]) for report)

I added a second query calculation called minRev with the expression
minimum(total([Revenue] for [Product line]) for report)

I went back to the report page, selected the list, and in the Properties property I checked maxRev and minRev as properties of the list.

I selected the Revenue column in the list, added a new Conditional Style, chose the Advanced Conditional Style option, and added two tests:

[Query1].[Revenue] = [Query1].[maxRev]

and

[Query1].[Revenue] = [Query1].[minRev]

I specified the desired style for each, and ran the report:

(https://image.ibb.co/ice7L5/Max_Min_zpsa58f540a.png)

Cheers!

MF.
Title: Re: Using Conditional Formatting
Post by: yogeswari on 11 Feb 2015 06:25:59 AM
Thanks a lot MFGF.

My sincere apologizes for late response due to health issue.
Yes i missed to mention the expression i used. 

Thank you very much, You are awesome and Great.
Million thanks :) :) :) :) :)