Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
pam1990
Contributor III
Contributor III

How to calculate weighted averages excluding zeros?

I have a measure with =(Sum(OCC*CURR_BOOK_VALUE)/Sum(CURR_BOOK_VALUE))/100 to calculate the weighted average, but I do not want to include OCC values of zero in the weighting. How do I accomplish that?

Labels (2)
1 Solution

Accepted Solutions
Digvijay_Singh

May be try this - 

(Sum({<OCC-={0}>}OCC*CURR_BOOK_VALUE)/Sum({<OCC-={0}>}CURR_BOOK_VALUE))/100

Pl share some sample data to try different options in case the above doesn't work

Thanks,

View solution in original post

2 Replies
Digvijay_Singh

May be try this - 

(Sum({<OCC-={0}>}OCC*CURR_BOOK_VALUE)/Sum({<OCC-={0}>}CURR_BOOK_VALUE))/100

Pl share some sample data to try different options in case the above doesn't work

Thanks,

pam1990
Contributor III
Contributor III
Author

That worked. Thank You!