Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

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

View solution in original post

11 Replies
tresB
Champion III
Champion III

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

tresB
Champion III
Champion III

qvw is blank!

sat_tok52
Creator
Creator
Author

Sorry..

Pls find the  attached 

tresB
Champion III
Champion III

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.?