Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dimension Legend Color Based on Expression Value

I have a stacked bar chart with four expressions (we can call them 'Exp1' through 'Exp4' for purposes of example.

The dimension is a date in the form 'MMM YY'.

I want to change the color of the dimension legend for any month/year where Exp3 is less than 0.

I tried the following (which is the contents of Exp3), but the legend remains black:

=IF(SUM(Total_Capacity)-SUM(Total_Enrolled) < 0, RED(), BLACK())

9 Replies
sunny_talwar

Would you be able to share a sample to see the issue?

Anonymous
Not applicable
Author

It would honestly take me too long to build a sample for you.

I tried to change the TextColor of the dimension with the IF statement above.

pipuindia99
Creator III
Creator III

Did you wrote the above said expression in the option called Background expression for colors in dimension field?

pipuindia99
Creator III
Creator III

Give a try in Visual clues tab present in the properties of a chart...

Anonymous
Not applicable
Author

I put it in the Text Color option for the dimension.

Anonymous
Not applicable
Author

Where would I find this tab? It's not in the properties form for the chart.

stabben23
Partner - Master
Partner - Master

Hi,

use column() to get Your Expression, in this case column(3) is where you have made Your Exp3. This is for background, do the same for Text Color.

dimensioncolor.GIF

pipuindia99
Creator III
Creator III

What Staffan said is the one which i meant, and if it is not working with this approach, do check the option called Visual clues as you could see in the screenshot of Staffan next to presentation and before Style tab.

stabben23
Partner - Master
Partner - Master

There is no settings for Dimensions in Visual cues, this is only for Expression.