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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate Mode() without 0

Hi Everybody

I want to have the mode of a field without 0.

This is an example for what i want to have:

Price:

0

0

0

15

16

15

15

0

If i use Mode(price), the result will be 0.

The result that i want will be 15.

I'm awaiting for any help.

Regards

Labels (1)
3 Replies
lblancher
Partner - Contributor III
Partner - Contributor III

Hi Jeff,

You could try Mode(if(Price <> 0,Price)), and see if you get the result that you are looking for.

Lucas

BizXcel Inc.

Not applicable
Author

Ifs are nasty memory hogs, and should be avoided if possible, especially on large datasets.

I would use set analysis.



=
mode({$<QUANTITY = -{0}>} QUANTITY)




Not applicable
Author

Thanks Lucas,

I try it and it works.

Many Thanks