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

Dynamic Color Expression

Hi,

Following is the table in my Data Model which may change this value at any time.

I'm using Bar Chart having multiple bars in which i want to use this range of color.

But i cant do it hardcore.because it may change at any time so i want to use variable.

How can i implement it at Background Expression? How implement it in Varibale?

ColorValue fromValue to
Green05
Amber 695
Red96100

Expression for Bar Chart are as follow

sum(total_exception)/sum(total_qty)*100

2 Replies
rubenmarin

Hi sandy, maybe you can use this background expression:

If([ExpressionName]<=Only({<Color={'Green'}>} [Value to]), Green(),

If([ExpressionName]>=Only({<Color={'Red'}>} [Value from]), Red(), Yellow()))

Or create a variable with that content and this bg expression:

$(VariableName)

Change the Green(), Red(), Yellow() for the RGB() you want, and [ExpressionName] to your current expression name, if the name is also an expression you can use [$(CopyNameExpressionHere)]

MarcoWedel

Hi,

maybe one solution using variables for the 2 limits could be:

QlikCommunity_Thread_211670_Pic1.JPG

QlikCommunity_Thread_211670_Pic2.JPG

QlikCommunity_Thread_211670_Pic3.JPG

QlikCommunity_Thread_211670_Pic4.JPG

hope this helps

regards

Marco