Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.

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

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