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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

wildmatch()?

What it the result of below statement?

wildmatch(Country,'IN*') >0

Labels (1)
6 Replies
maleksafa
Specialist
Specialist

wildmatch(Country,'IN*')  will return 1 if the Country starts with 'IN', this might be a condition to show or hide a value based on the country name again if it starts with IN

anbu1984
Master III
Master III

wildmatch(Country,'IN*') >0 -- Similar to Country LIke 'IN%' in Sql

datanibbler
Champion
Champion

Simple: WildMatch() allows for Wildcards

- * for any number of digits

- ? for exactly one digit

Not applicable
Author

That thing i know but why we use >0 here plz tell me

rubenmarin
MVP
MVP

Hi rakesh, match and wildmatch returns an integer telling the first expression to search that was found, and 0 (zero) in case none was found.

=WildMatch('ABCD', 'AB*', '*CD') --> Returns 1 (the 1st "search expression" was found)

=WildMatch('ABCD', '*AB', '*CD') --> Returns 2 (the 2nd "search expression" was found)

So asking for >0 is telling that one of the search strings was found.

MarcoWedel
MVP
MVP

Hi,

in case you are using this expression as a condition like

If(wildmatch(Country,'IN*') >0, returnvalue1, returnvalue2)

then you can skip the >0 part:

If(wildmatch(Country,'IN*'), returnvalue1, returnvalue2)

will work the same way, because this comparison also returns a non-zero value (true = -1) in case country matches 'IN*'.

hope this helps

regards

Marco