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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Udayk76
Contributor II
Contributor II

if condition using wild cards

Please any can any one help me with the below scenario,

I have a scenario, where if a record in a column contains a word "jenkins" then i want to create a new column and mark the particular record as a "bug", if not keep the record as it is.

I tried the below if condition but unfortunately qlik doesn't support wildcards

tried this in table: if(field1 = '*jenkins*', 'bug', field1)

tried this in script: if(field1 = '*jenkins*', 'bug', field1) as 'field2'

 

Thanks in advance

Labels (2)
1 Solution

Accepted Solutions
Udayk76
Contributor II
Contributor II
Author

Thank you @MarcoWedel  @henrikalmen  @kaushiknsolanki  for your help. I'm really thrilled for your prompt response. The above like and wildmatch functions worked like a magic. They satisfied the requirement. Thanks again. All the best. 👍

View solution in original post

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi you should try below.

if(wildmatch(field1,'*jenkins*'), 'bug', field1)

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
henrikalmen
Specialist II
Specialist II

Use wildmatch(), it supports wildcards. So something like if(wildmatch(field1, '*jenkins*'), 'bug', field1)

MarcoWedel

you could also try the 'like'-operator instead of the '=' sign, i.e.:

if(field1 like '*jenkins*', 'bug', field1)

https://help.qlik.com/en-US/sense/February2023/Subsystems/Hub/Content/Sense_Hub/Scripting/Operators/....

 

Udayk76
Contributor II
Contributor II
Author

Thank you @MarcoWedel  @henrikalmen  @kaushiknsolanki  for your help. I'm really thrilled for your prompt response. The above like and wildmatch functions worked like a magic. They satisfied the requirement. Thanks again. All the best. 👍

Udayk76
Contributor II
Contributor II
Author

Just wanted to know, is there a way to check whether wildmatch function is efficient or the like function is efficient. As both functions are satisfying the requirement. 

 

Thanks in advance