Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

How to have different background color expression for a Grouped dimension

Hi Guys,

I am using a cyclic grouped dimension( group of Region and Country dims) for a bar chart.I have mapped each region and country to a color code file. So each region and country will have a unique color code. Now when I am creating the chart with this dimension and an expression, how can zi use both region and country color codes. If I use Region_color_code in the background expression then I get correct colors on the bars if user has selected Region dimension but it won't work obviously when he/she switches to Country.

So, please let me know if there's a way I can use both region color code and country color code simultaneously  in the chart.

Any help will be appreciated.

Thanks!

2 Replies
juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

There's a GetCurrentField() function which allows you to distinguish which field of a group is currently viewed. You can set a condition based on that:

If(GetCurrentField(GroupName)='Region', Region_color_code, Country_color_code)

pranaview
Creator III
Creator III
Author

Thanks Juraj. It worked nicely.