Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different graph bar color depending on total graph average

Hello!

I've managed to accomplish different graph bar color depending on the expression of that graph exceeds a given number, e.g. if the sales are lower than $XXX, color the bar red.

What I want to accomplish is to color a bar in a certain way if the sales is higher/lower than the average sales shown in that particular graph.

In the "expressions" tab, you can choose to draw an "average" line, but how do I access the average value as to be able to compute colors using it?

Best regards,

Niklas

2 Replies
Not applicable
Author

Hi,

go in the expression section, click "+" of your expression.

Then in the background section, enter a formula to manage the color

example : =if( [M+6 vs MPAP] > 0 , color(2) , color(1)) => if my expression is >0 the put color(2), otherwise put color(1)

color(2) is the second color in the panel

JJ

Not applicable
Author

Thank you for your answer.

However, my question was how to use the average sales when calculating the color. I want to display a RED bar when the value of that particular bar is lower than the average bar IN THAT GRAPH.

That is - if the graph displays daily sales between january and march, I want to highlight the days in this period with a sub-average sales in red. How can I do that?