COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: krishdw85 on 05 Aug 2015 07:34:35 AM

Title: Dynamic conditional formating required for Top 3 values
Post by: krishdw85 on 05 Aug 2015 07:34:35 AM
Hi Cognos Guru's,

How to create the conditional formating for top 3 values and values are not static it is dyanmic , always top 3 has to be highlighted with red color.
Attached is the screenshot for reference .
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: R Ambre on 05 Aug 2015 07:49:56 AM
Hi,

Just create new data Item and apply Rank ( "Fact Query Item which needs to be highlighted" DESC).
In List properties > Data > Properties add this new data item.

And Then apply conditional style on Fact needs to be highlighted.
Code for conditional style

([Query1].[New Data Item] = 1) or ([Query1].[New Data Item1] = 2) or ([Query1].[New Data Item1] = 3)

Let me know if it doesn't work
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: krishdw85 on 05 Aug 2015 08:36:30 AM
Hi, Thanks for your prompt response, Based on your suggestion tried applying, but did nt went well.  Can you pl check and suggets. Thanks for your prompt response.

Let me explain...
created Data Item1 as rank ([Case Count] desc for [Internal Status Labe])  and set property Data Item1 after that created cond formatting

COnditional formating:
([Completed Step SLA Analysis_New].[Data Item1]=1) or
([Completed Step SLA Analysis_New].[Data Item1]=2) or
([Completed Step SLA Analysis_New].[Data Item1]=3)
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: krishdw85 on 05 Aug 2015 11:22:37 PM
Any inputs please
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: R Ambre on 06 Aug 2015 12:11:39 AM
Hi,

Could you please tell me what error you are getting ..so that I can help you ?
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: bvk.cognoise on 06 Aug 2015 01:36:26 AM
HI krishdw85,

Please try below mentioned steps

>create a query item with following expression

Eg:Rank (Query Item Name)

rank(total([No. Classes with completed steps] for [Key Milestones])for report)

>Then create a Boolean variable using following expression

Rank<=3

>Then assign this variable to your report body apply formatting as per requirement

>then select entire list in the properties>Properties check Rank

then run the report.


PFA xml for reference.

Regards
Bvk

Title: Re: Dynamic conditional formating required for Top 3 values
Post by: krishdw85 on 06 Aug 2015 05:36:24 AM
Appreciate BVK Cognos, i am able to get for values , but nt able to format red color to dimension. With corresponding fact top 3 values, dimension also has to change to red color. Please see first post in that i highlighted it.
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: bvk.cognoise on 06 Aug 2015 06:30:49 AM
HI krishdw85,

Please apply same variable to dimension as well.

PFA screenshot.


Regards
Bvk
Title: Re: Dynamic conditional formating required for Top 3 values
Post by: krishdw85 on 06 Aug 2015 06:38:16 AM
Thank you very much mite, appreciate it worked fine.