Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

Why doesn't this simple line background colour expression work?

Hi,

I have the following chart:

Dimension: MonthYear

Expression: Count(Distinct OrderID)

In background colour for the expression is If(Count(DISTINCT OrderID) > $(vAVGOrders), LightBlue(), LightGreen())

My variable vAVGOrders expression is: Avg(Aggr(Count(DISTINCT OrderID), MonthYear))


Why doesn't my chart above change to lightblue colour when the line is going over Avg # Orders? What do I need to change please?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Put an = character in front of the expression in the variable so that it's calculated outside the context of the chart. Otherwise it will be calculated for every MonthYear value and then the average is always the same as the count because the average will be calculated on only one value.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Put an = character in front of the expression in the variable so that it's calculated outside the context of the chart. Otherwise it will be calculated for every MonthYear value and then the average is always the same as the count because the average will be calculated on only one value.


talk is cheap, supply exceeds demand
sunny_talwar

May be try with this as your variable:

Avg(TOTALAggr(Count(DISTINCT OrderID), MonthYear))

jblomqvist
Specialist
Specialist
Author

Thanks guys you are both correct.