Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AVG function wrong results

Dear all, I am building some bar charts and some metrics throughout AVG function.

I don't have any missing values in my dataset. The value that I get in Qlik Sense, both in charts and in tables,  is around 89.03, which is a wrong result. The true value is 88.87629904.

If I export the data to excel and compute the sampling average, I get 88.87629904.

If I import again this data to Sense I get the true value: 88.87629904.

This is really weird.

Any insights?

Thanks in advance.

Nico.

6 Replies
Kushal_Chawda

try,

=sum(aggr(avg(Value),DimensionInChart))

Ricardo_Gerhard
Employee
Employee

Dear Nico,

    Sometime, this issue is related with your data set with null or 0 values. Try use sum(data)/count(data) instead of AVG

    Please mark the CORRECT/HELPFUL comments.

Regards.

Ricardo Gerhard
OEM Solution Architect
LATAM
vinieme12
Champion III
Champion III

you might also want to read the below

Average – Which average?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

It doesn't work.

Not applicable
Author

I'd try that. However the results remain wrong.

ToniKautto
Employee
Employee

I am not aware of any problem with the Avg() function. The reason is most likely that content in your data, or that you data model leads to an unexpected data set for example through a synthetic key.

It is impossible to explain the result you get without seeing the actual data you have in the application. Please attach a sample app file, for further advise.