Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Bharathi09
Creator II
Creator II

If condition in scripting

Hi all,

I have one requirement

I have dataset with columns parts and code

I need to add new country column in script like : 

if any of the code = 34 or 35 country = Canada 

if any of the code =14, 20 OR 43 country = Mexico

if any of the code = 34 or 35 and 14, 20 OR 43 country = Both

all this should be appear as country column

Bharathi09_0-1663581705686.png

 

 

Please help

 

Thanks in advance

Labels (1)
2 Replies
Vadimb
Partner - Contributor II
Partner - Contributor II

hi,
try this
,if(WildMatch(code, 34,35), 'Canada'
,if(WildMatch(code, 14,20,43), 'Mexico'
,if(WildMatch(code, 34,35) AND WildMatch(code, 14,20,43), 'Both'))) as country
Bharathi09
Creator II
Creator II
Author

Hi ,I'm not getting 'BOTH' in output

Please help

Thanks in advance