Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
Showing results for 
Search instead for 
Did you mean: 

Colour by Expression or Colour by Measure


I'm building a demo app for a project, and the customer has given me colour codes for targets, red, amber and green.  I am OK with building a variable and passing it a measure to return the colour code, however, one of the other charts I built is coloured by measure, using the customers colours from the theme I built.

One of the customers has asked if they can toggle between the target colours and the "nice" colours in the TreeMap chart.

For one, I have to edit the page and set the Appearance:Colours and Legend:Colours=by Expression, and enter the Expression, for the other I have to set it to by Measure, select the measure and select the colour theme.

So I can build two versions of the same chart, pop them in a container, and show them conditionally using a button, but I wondered if any community geniuses had a way to do this just using one chart, and by expression, but being able to create an expression that mimics the by measure mode and selects a colour scheme?

the current expression is toggled using a selector variable:

pick($(vAnalysisPageShowColours),'#8C770E',$(vTargetTVColourCalc_OTIF([OTIF])) )

But could I replace the hard coded colour with an expression that mimics what Qlik Sense does when you select By Measure?


Is there a way to do this?

2 Replies

Hello @SimonBall  do you mean changing by dimension like this article explains?


Please let me know 🙂

Help users find answers! Don't forget to mark a correct resolution 🙂

Thanks for the link, I'm able to use that option to set colours for dimension options, but I need to be able to toggle between by expression and by measure options and that doesn't seem possible.