Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with Expression.

My requirement is to fade the color of Bars in a Bar-Chart gradually. Each bar represent a represent revenue by country. We have only 10 bars (as we select only top 10 countries by revenue, so I used RANK).

I am using the expression in "Background-Color" of the chart as:

if(aggr(rank(sum({<[Country Name]-={"Wor*","OECD*","South*","High*","*Sahara*","Low*","Latin*","Heavily*","Least*","Fragile*","European*","East *","Euro*","Arab*", "*iddle*","North A*"

}>}Population)),[Country Name])<=1,RGB(33,52,73))

In the above expression we are excluding certain countries.

I have to write this expression again and again in "if-else" format means if Rank<2 then "Color Code-2"...if Rank ❤️ then "Color-Code-3",

So is there a way where I can use the entire RANK operation inside a variable and use that variable instead?

1 Solution

Accepted Solutions
PrashantSangle

Hi,

like

Pick(YourExpression,RGB(assign_rgb_value_for_1_rank),RGB(assign_rgb_value_for_2_rank),RGB(assign_rgb_value_for_3_rank), and so on)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
PrashantSangle

Hi,

try with pick()

See in help menu for detail.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

like

Pick(YourExpression,RGB(assign_rgb_value_for_1_rank),RGB(assign_rgb_value_for_2_rank),RGB(assign_rgb_value_for_3_rank), and so on)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

That worked like a charm!!! Thank you so much!