Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
EMaebe
Contributor II
Contributor II

Pick Match vs If Match: grouping a dimension

I have a "flag" dimension with 7 values (A, B, C, D, E, F, G). I want to group into 3 groups as A-C is "Group 1", D-F is "Group 2", G is "None".

Would the best way to do this be

=If(Match(Flag, 'A','B','C'), 'Group 1', if(match(Flag, 'D','E','F'), 'Group 2', 'if(match(Flag, 'G'), 'None')

or should I use pick match? If so, how would that formula be structured?

 

A coworker shared the if(match() statement that they've used in a previous dashboard they created, but their formula had the first if(match() statement as wildmatch. How do I know when to use that? They weren't sure why they used wildmatch vs just match. 

Labels (4)
1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

I don't know which is less work for the Qlik engine to calculate, but the Pick version would look like below;

=Pick(Match(flag,'A','B','C','D','E','F','G'),'Group 1','Group 1','Group 1','Group 2','Group 2','Group 2','None')

A few thoughts from folks who would know more than me here;

Pick Match vs Nested If Performance - Qlik Community - 1174461

Generally if you are using this a lot then that is a sign to get it added to the data model ...

Wild match just allows you to put wildcards (*, ?) in;

wildmatch - script and chart function ‒ QlikView

Cheers,

Chris.

View solution in original post

2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

I don't know which is less work for the Qlik engine to calculate, but the Pick version would look like below;

=Pick(Match(flag,'A','B','C','D','E','F','G'),'Group 1','Group 1','Group 1','Group 2','Group 2','Group 2','None')

A few thoughts from folks who would know more than me here;

Pick Match vs Nested If Performance - Qlik Community - 1174461

Generally if you are using this a lot then that is a sign to get it added to the data model ...

Wild match just allows you to put wildcards (*, ?) in;

wildmatch - script and chart function ‒ QlikView

Cheers,

Chris.

EMaebe
Contributor II
Contributor II
Author

Thank you! That worked, and helped my understanding of applicable use of the expression.