Discussion board where members can get started with Qlik Sense.
I've got a simple bar chart, with an Average calculation reference line. Thus far, it looks like this.
What I would like is that when the Bar is above the reference line, it's Blue and when it's below the reference line it's Green
My expression looks like so:
If( Count(Order) > Avg(Aggr(Count(Order),[Scheduled Week])), Blue(), Green())
But not matter what, the bar is ALWAYS green. What should I be using to get this to work? For instance, the value 226 should be Blue as it is above the average and the value of 184 is below the average.
Any help is greatly appreciated.
Go to Solution.
Your bar chart seems to be suffering from an inverse "Lake Wobegon effect" (Lake Wobegon - Wikipedia).
Add a TOTAL keyword.
If( Count(Order) > Avg(TOTAL Aggr(Count(Order),[Scheduled Week])), Blue(), Green())
Try Putting your expression in a variable and then try.
Something like this
if( Sum(Sales) >
$(vAvg),Blue( ),Green( ) )