Qlik Community

Ask a Question

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

What is a better way to write IF expressions with an ELSE?


I am aware that Pick Match can be a better way of writing an IF expression.

However, what is a better way to write an IF expression if the expression has an ELSE in the code too?

3 Replies

What is the expression? You can write Pick(Match()) in case of else as well....

Specialist II
Specialist II

You're probably going to want to be more specific about your use case.  If/Else can be substituted for things like Match, and multiple ApplyMaps depending on how exotic you want to get.

MVP & Luminary
MVP & Luminary

One way could be to wrap a pick(match()) within an if-loop to fetch the else-part or if your results are only numeric you could use alt(pick(match()), ElsePart).

Another possibility might be to use an else-part within the pick(match()) maybe in this way:

pick(wildmatch(Field, 'a', 'b', '*'), 'a', 'b', 'else')

- Marcus