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: 
SimonBall
Partner - Contributor II
Partner - Contributor II

Colour by Expression or Colour by Measure

Hello.

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?

Labels (2)
2 Replies
Patricia_Silva
Specialist II
Specialist II

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

https://support.qlik.com/articles/000034565

Please let me know 🙂

Help users find answers! Don't forget to mark a correct resolution 🙂
SimonBall
Partner - Contributor II
Partner - Contributor II
Author

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.