Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JacobML
Contributor II
Contributor II

If the value is "Unknown" show next highest value

Hi Qlik experts,

I am very new to the Qlik syntax and i have tried my best to make a correct IF statement.

The issue is that in my data i have a lot of "Unknown" values. This is in a dimension where "Unknown" means that the user has not answered this question.

I am categorizing users by "Type of Workplace" in a dimension, where i have:

Workplace 1
Workplace 2
Workplace 3
Workplace 4
Unknown

I am using mode( to find the "most common value") that has selected the specific type of workplace and this is working.

What i want to do now (since i have a lot of Unknown values) is an IF statement (or other solution) to show the next most common value if the value is Unknown.

I hope this makes sense.

Thank you!

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Mode({<Workplace -= {'Unknown'}>}Workplace)

View solution in original post

4 Replies
sunny_talwar

Are you doing this in the script or front end? What is the code/expression you are using right now which gives you unknown?

JacobML
Contributor II
Contributor II
Author

This is front-end (chart expression)

Right now I am simply using mode(Workplace) and this is working very well.

sunny_talwar

Try this

Mode({<Workplace -= {'Unknown'}>}Workplace)
JacobML
Contributor II
Contributor II
Author

Amazing, thank you so much!