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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incorrect Result using Avg()

Hello All,

I have data with null values in Qty on which I am trying to apply Avg()

Can I achieve it simply by using Avg() only & not by Sum()/Count() method?

Regards

Kiran

P.S. I have attached sample qvw for further information.

Labels (1)
1 Solution

Accepted Solutions
anlonghi2
Creator II
Creator II

Hello Kiran,

try with this:

Avg(if(isnum(Quantity),Quantity,0))

Best regards

View solution in original post

3 Replies
anlonghi2
Creator II
Creator II

Hello Kiran,

try with this:

Avg(if(isnum(Quantity),Quantity,0))

Best regards

sunny_talwar
MVP
MVP

Try this expression:

=Avg(Aggr(Sum(If(IsNull(Quantity), 0, Quantity)), [Material Code]))

HTH

Best,

Sunny

Not applicable
Author

Hi Kiran,

I think a possible solution could be replace null values with zeros in script.

Best Regards

Pablo