Skip to main content
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Reference Line in Qliksense

Hi All,

I am trying to get the average of a particular column as a reference line. If I calculate manually I am getting average 

as around let's say 3500. But when I use the expression of average of that particular column let's say 

Avg(usage_cnt) the average comes and falls somewhere on "0" line in the chart. Not sure where it is going wrong. 

However if I enter a particular value manually let's say 4000 in Reference Line expression tab, the line is showing correctly. 

I am not sure where it is going wrong. Can some one help with me on this.

Thank you in advance. 

Labels (3)
4 Replies


As per your statement it works fine when calcualted manually, what is the formula used for calculating average ?

Also remember AVG() function calculates it at entire data model level considering all fields.

Contributor II
Contributor II

I have used  Avg(column) not working.

tried =sum(column)/count(column) ...this is also not giving me goes and falls somewhere on '0' line in the chart. 

I didn't calculate manually...I inserted the average number manually in "Reference Line Expression" tab then the average line is depicting properly.

I used =sum(usage_cnt)/GetPossibleCount(usage_cnt) expression,I was able to get the reference line but the average value it was showing was wrong.

Does anyone know solution for this issue.




@KavyaM It is important what Value is giving the one you have written in KPI? Is this giving 4000 in KPI and the same not showing in Reference line?

Perhaps this? Avg(TOTAL usage_cnt)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Contributor II
Contributor II

Please ignore the values I have provided, it's just some random numbers. 

What I am trying to achieve is - I have a bar chart with Date and Region (Dimensions) as X axis and sum of Usage count column (Measure) as Y axis. Let's say I have date for 5 days. I am trying to get the average of those 5 days volume as Reference Line by using expression. None of the above-mentioned expressions are helping. Whatever expression I use the value is showing somewhere between 0 and 1. However the true average of the given data is 5,600. Contrary to that if I directly enter the value in "Reference Line Expression" tab,avearage line is showing correctly but I want to get it by using expression because the data changes on a daily basis so as the average.

Point here is I am unable to get the AVERAGE of the data using Reference line expression. (Not sure which expression I should be using)

Any help on this is much appreciated.