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: 
Andrew_ENT
Contributor III
Contributor III

Wildmatch Function Not Working in Where Clause

As per the image below, the function

-- Where wildmatch("Object number",'OR%')>0

was not working. I couldn't figure out why it wasn't working but had tracked the problem down to here. So, I tested the alternative approach

-- Where Left("Object number",2)='OR'

Which worked.

I no longer have a problem, but I do have a curious learning point as I cannot possibly explain why the original function didn't work. Any ideas?

Andrew_ENT_0-1748359053903.png

 

Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

"%" is not a Qlik wildcard character. So your expression would only match the case-insensitive string "OR%". Is that what you intended?  If you are trying to match "OR" followed by an single character the mask would be 'OR?'.

-Rob

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

"%" is not a Qlik wildcard character. So your expression would only match the case-insensitive string "OR%". Is that what you intended?  If you are trying to match "OR" followed by an single character the mask would be 'OR?'.

-Rob

MatheusC
Specialist II
Specialist II

@Andrew_ENT 

As @rwunderlich  said, ‘%’ is not a character used in Qlik, you can use ‘*’:
For example in SQL, you will filter the values ​​that start with OR by doing something like
Where Filed like 'OR%', for Qlik you can do it like Where WildMatch(Filed,'OR*')>0;

note:  This way it filters both upper and lower case letters

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
Qrishna
Master
Master

Try: Where wildmatch([Object number],'OR*')>0 - this does the wild search on 'OR' but wil search on charaters that are right to 'OR', '*OR*' -  this does wild searh and returns all the field values that contan 'OR' no matter where the location of 'OR' in the field value is.

- Where Left("Object number",2)='OR' -  this looks only for 'OR' in the first 2 characters of the field value.

Andrew_ENT
Contributor III
Contributor III
Author

Ahhh of course, when I write it in Qlik I do use * but this was copied across from a SQL script and edited. Thanks for spotting this. Sometimes you can be staring at something so long that you cannot see the wood for the trees!