Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I've been chasing an unexpected behaviour this afternoon and have narrow it down to this: the LIKE operator seems to confuse hyphens and single quotes. Specifically, both of these expressions evaluate to logical true (-1):
Has anyone else come across this? Looks like a product defect to me.
I'm using QlikView 12.0. Does it happen in any more recent version?
Update: I've tried this in my company's QlikSense environment (12.674.4 / 4.0.X) , and it works correctly. So, it looks like it's a problem already resolved in that engine version.
I can confirm that I too am experiencing the same unwanted behavior. Also when I try few more things to understand the qlik engine behavior, I found that this happens so when we are comparing using a wild card function. I.e. - if you use direct comparison with '=',
chr(39)='-' // returns 0 - OK
Match(chr(39), '-') //returns 0 - OK
however, if we use wildcard functions - LIKE/wildmathc() - it behaves unexpectedly
chr(39) Like '-' //returns -1 ; Wrong
Wildmathc(chr(39), '-') //returns -1; Wrong
That means, possibly qlik engine is doing something additional for such cases of comparison. May be @hic , would have some ideas .
did not get your query. what are you trying to do?
I can confirm that I too am experiencing the same unwanted behavior. Also when I try few more things to understand the qlik engine behavior, I found that this happens so when we are comparing using a wild card function. I.e. - if you use direct comparison with '=',
chr(39)='-' // returns 0 - OK
Match(chr(39), '-') //returns 0 - OK
however, if we use wildcard functions - LIKE/wildmathc() - it behaves unexpectedly
chr(39) Like '-' //returns -1 ; Wrong
Wildmathc(chr(39), '-') //returns -1; Wrong
That means, possibly qlik engine is doing something additional for such cases of comparison. May be @hic , would have some ideas .
I'm asking to see if others agree that this behaviour of the LIKE operator is defective, before I submit it to Qlik for them to fix in a future release.
For the record, I'm not asking for help with my code - I've already implemented a workaround.