Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sat_tok52
Creator
Creator

Avg Calculation in qlikview

Hi Guru's,

I am calculating sum(Days) in my barchart it is showing the no of days 9 it is correct ,I want to calculate AVG of the days,I used Avg(Days) expression in my chart it still showing 9 but as per my requirement it should show 4.5.  Any help.

-Sateesh

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Sum(Days)/Count(Total {<Name>}Days)

View solution in original post

11 Replies
tresesco
MVP
MVP

Could you post a demonstrative sample qvw? Or try, like:

Sum(Days)/Count(Total Days)

jonathandienst
Partner - Champion III
Partner - Champion III

Nulls are not considered in the Avg calculation. Therefore is is taking the average of the non-null values only. If you post your qvw or a representative sample, you will get specific help on how to work around this in your case.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sat_tok52
Creator
Creator
Author

Hi Tresesco ,

Thanks for your quick reponse.

It's fine with out any selection , if I select Customer Name  A the sum(days) of customer is 9 ,I wanted to see the avg of Customer Name  A like 4.5 but it is showing still 9.

-Sateesh

sat_tok52
Creator
Creator
Author

Thank you Jonathan,

Attached is the QVW.

Thanks,

Sateesh

tresesco
MVP
MVP

qvw is blank!

sat_tok52
Creator
Creator
Author

Sorry..

Pls find the  attached 

tresesco
MVP
MVP

Sum(Days)/Count(Total {<Name>}Days)

tamilarasu
Champion
Champion

Check the below expression

=Sum(Days)/Count(ALL Days)

tamilarasu
Champion
Champion

Tresesco,

If I add one extra field, I am getting wrong result .? What If I have more than 3 fields.?