Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lisandramelo
Contributor
Contributor

Excluding Null Values From Mode()

So, I am trying to use the Mode() function in a column, but I don't want the null values present in the column to be considered while the Mode() is calculated, because they are the majority and thus the mode is returning null.

I've already tried two things to remove the values that I found in the community discussions:

1st - Mode({<[field] -= {'=Null()'}>} [field])

2nd - Mode({<[field] = {'*'}>} [field])

The first alternative doesn't remove any null values, the second appears to break the mode() and make it always return null.

Is there any other way I can achieve what I'm trying to do?

Labels (4)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

2nd but with double quotes - Mode({<[field] = {"*"}>} [field])

You cannot use single quotes in searches:
https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824 

View solution in original post

2 Replies
hic
Former Employee
Former Employee

2nd but with double quotes - Mode({<[field] = {"*"}>} [field])

You cannot use single quotes in searches:
https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824 

lisandramelo
Contributor
Contributor
Author

Oh, I didn't know that. It started working, thank you very much.