Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

PICK ( WILDMATCH ( Dimension Question

Hello QV Community,

I am making a pivot table that will show total email vs total mail. I have a field labeled FName which has the location name and type of communication so I need to search the whole text for just 'mail' or 'email', and I need to just show email and mail. When I use the below expression, the figures are correct and it shows the label Email, but not the label Mail (it shows a dash ' - ' ). How can I adjust this to show both Email and Mail?

=

PICK(WILDMATCH(TRIM(UPPER(FName)), '*EMAIL*') ,'Email','Mail')

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If wildmatch doesn't match anything it will return 0. And you specified only one match pattern. Pick starts at 1, so feeding pick a 0 won't give a result. So try this:

PICK(WILDMATCH(TRIM(UPPER(FName)), '*EMAIL*')+1 ,'Mail','Email')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If wildmatch doesn't match anything it will return 0. And you specified only one match pattern. Pick starts at 1, so feeding pick a 0 won't give a result. So try this:

PICK(WILDMATCH(TRIM(UPPER(FName)), '*EMAIL*')+1 ,'Mail','Email')


talk is cheap, supply exceeds demand
Not applicable
Author

Perfect, thank you for the correction and explanation.