Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditionally colouring Bars in a Chart/Reference Lines

Hello.

I have a bar chart detailing sales for my companies.

I want to display a reference line with the mean of the sales for that company. (Avg(Amount)). I also want to display 2 more lines showing +/- vThreshold%. So far I think I have implemented these.

I now I want to colour the bars on the chart which do not fit within the specified threshold. So if the average is 50 and the theshold is 10%, a value of 60 or 40 will be red, and blue otherwise

It makes much more sense in the attached file. Im sure theres some set thing im missing in my Background Color expression. Help!

1 Solution

Accepted Solutions
whiteline
Master II
Master II

I think, you've forgotten about total qualifier:

=if((Amount < avg(total Amount)      *(100-vThreshold)/100)    ,LightRed())

View solution in original post

2 Replies
whiteline
Master II
Master II

I think, you've forgotten about total qualifier:

=if((Amount < avg(total Amount)      *(100-vThreshold)/100)    ,LightRed())

Not applicable
Author

Try this.