
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If statement with multiple conditions
I need to write an if statement in QLIK Sense that checks one column in a table for multiple conditions.
Essentially, I need to check if the column has 'Red', 'Blue', or 'Green' and if it does, show the data.
I know how to limit it to one:
=if([Color]='Blue',[Color])
but I am unsure the syntax of multiple conditions as a new user. Ideally, I would prefer to make the colors a variable so if the requirement changes, I only have to change it in the variable instead of in the expression editor.
Any help is appreciated
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use logical OR statements, e.g.
If(Color = 'Blue' or Color = 'Green' or Color = 'Red', Color)
You could also use Match:
If(Match(Color,'Blue','Green','Red'),Color)
Using a variable might be tricky because you want to be able to use multiple colors, but if you just want to allow one additional color to be selected in the variable, you could add/replace the variable into the color list.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use logical OR statements, e.g.
If(Color = 'Blue' or Color = 'Green' or Color = 'Red', Color)
You could also use Match:
If(Match(Color,'Blue','Green','Red'),Color)
Using a variable might be tricky because you want to be able to use multiple colors, but if you just want to allow one additional color to be selected in the variable, you could add/replace the variable into the color list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
