Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Tafarello
Contributor
Contributor

Change colors in different measures in bar chart

Hello Community!

The issue is the following, i have a bar chart with a Dimension and two different Measures. I am adding a QVF so you guys can check it out. I am using April2019 Qlik Sense. The idea is that i need to change the color of the different measure bars, however I do not have any number set or greater then type condition to make it change color, only the whole bar needs to be different. For example, it does not work to go IF measure<0 then rgb(1,1,1). It will need to be a change that always affects the masures. Not only that, but it has to be different colors for each dim1. As in my case, there are 5 regions and we are seeing 2 measures for each region, and each region has a color scheme that we need to mantain, so i cant change the color in the master measures either, as it will be always the same.

I have checked this link https://community.qlik.com/t5/New-to-Qlik-Sense/How-to-change-the-color-of-differents-column-of-a-Ba... to try their solution, but in their case they change it to have 2 dimensions.

Please, could i get a hand here? Thanks!!

Labels (2)
1 Reply
Dalton_Ruer
Support
Support

Check out the ValueList function by clicking here.

Step 1: Create the chart as one that can handle 2 dimensions like a TreeMap.

Step 2: Add your real dimensions and a formula for the ValueList like this: ValueList('Measure1', 'Measure2')

Step 3: You would only create 1 measure that is based on which of the values from the value list you are on. Like "If(ValueList('Measure1', 'Measure2') = 'Measure1', RealExpression1, RealExpression2)"

Step 4: In the color use Expression and do a similar expression to the measure but the expressions would evaluate to the color codes you want to use. 

Or Create a Master Dimension for the ValueList function and assign your colors there so no matter where you reuse them you would get the appropriate colors and them color by that dimension instead of creating expression. 

ValueList.png