Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser09
Creator II
Creator II

calculating average with conditions

I am calculating the average in Qliksense bar chart, this is the formula I'm using

Sum(Value)/Count((no of groups)), when I do this some of the averages are correct and some of the averages are incorrect, then I found that they are only taking into account values greater than  0. so I want to add a condition to my formula, to include values only that are greater than zero. Any help on this??

1 Solution

Accepted Solutions
anthonyj
Creator III
Creator III

Hi @Qlikuser09 ,

If you only want to count Values that are greater than 0 you can add a set analysis to exclude 0's.

Sum({$<Value={">0"}>}Value)

Take in to account whatever is done in the numerator may have to be reflected in your denominator as well depending on your data structure.

Thanks

Anthony

View solution in original post

1 Reply
anthonyj
Creator III
Creator III

Hi @Qlikuser09 ,

If you only want to count Values that are greater than 0 you can add a set analysis to exclude 0's.

Sum({$<Value={">0"}>}Value)

Take in to account whatever is done in the numerator may have to be reflected in your denominator as well depending on your data structure.

Thanks

Anthony