Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
TeodoraBurlica
Partner - Contributor III
Partner - Contributor III

Wildcards for a field or alternatives

Hello,

 

I have this wildmatch function: if(wildmatch(field1, '*1234*', '*12345*'), 'ok', 'nok') and I wonder if the hardcodes can be replaced with a field from the database, but work on the same principle with *.

I know that wildmatch(field1, *field2*) doesn't work. Is there any alternative?

Field1 is a field with several concatenated codes, and I want to match with the other field that has just one code.

 

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Nicolae_Alecu
Creator
Creator

Hello,

 IF(WILDMATCH(field1,'*'&field2&'*'),'Ok','Nok')

Code:

A:
Load
field1,
field2,
if(Wildmatch(field1,'*'&field2&'*'),'Ok','Nok') as WildMatch
Inline [
field1 , field2
1-01-1,01
2-02-2,02
3-01-3,03];

 Output:

Nicolae_Alecu_0-1717071363208.png

Best Regards,

 

View solution in original post

1 Reply
Nicolae_Alecu
Creator
Creator

Hello,

 IF(WILDMATCH(field1,'*'&field2&'*'),'Ok','Nok')

Code:

A:
Load
field1,
field2,
if(Wildmatch(field1,'*'&field2&'*'),'Ok','Nok') as WildMatch
Inline [
field1 , field2
1-01-1,01
2-02-2,02
3-01-3,03];

 Output:

Nicolae_Alecu_0-1717071363208.png

Best Regards,