Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating dynamic color selection for Measures

hi,

I am using the 'Option button' to enable dynamic measure selection. I further want to make the color in my chart also dynamic, pertaining to which measure gets selected. However, it's not working.

if( $(Metric) = 'NM', rgb(0,139,0))

/ / where :Metric is the variable I have created using 'Option button'

               NM is one of the values the Metric variable takes

Appreciate the help !

Malvika

7 Replies
Anonymous
Not applicable
Author

Did you check this??

color by expression - QlikSense

Not applicable
Author

Hi Balraj,

Thank you for sharing this. However, this only talks about color by expression for different dimensions, whereas, i am looking for dynamism for measures.

isaaclin
Contributor III
Contributor III

will you try background expression under Measures?

Capture.JPG

satishkurra
Specialist II
Specialist II

Quickly, Is it something you are achieving in QV or QS?

Not applicable
Author

In Qlik Sense, under data and the measure in question, you have the option to setup a background colour expression.

You could have, for example:

If([Column Name / Metric] = 'NM' LightRed(), If([Column Name / Metric] = 'XX', Yellow()))

You could then apply alternative expressions to each measure.

Not applicable
Author

I am doing this in QS

Not applicable
Author

Hi Michael,

I am afraid I did not quite fully understand what you meant. I had an understanding that Colors for measures can be changed using the Color by expression option. Since I am using dynamic measures based on selection using the 'Option button' extension, I have created a new variable. I want the color to change based on the value I select from the button. Your expression and the one that I am trying to use do not give me desired results.

Appreciate your assistance !