Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

What is the error in this expression?

HI All,

I am not able to figure out the issue with this expression:

=Count({<upper([Curr Status])={'MET'}>}Key)

Please help.

Thanks

Sam

17 Replies
maxgro
MVP
MVP

added another one, *MET*

1.jpg

Anonymous
Not applicable
Author

Now instead of enjoying Australian lamb and Californian wine, I have to test myself 

OK, I tried with and without wildcard, with single and with double quotes and without any, and result is the same - not case sensitive.

So the difference that I use it in a text box and Massimo's are in a table.  Would it matter?

Another assumption - QV version.  I'm using 11.20 SR10.

Anonymous
Not applicable
Author

Nice!

Adding one more, without wildcards, returns all three, to make it more confusing.

=count({$ <CurrStatus={'Met'}>} Key)

Anonymous
Not applicable
Author

Here is what's going on, at least what I can see now:

It is not case sensitive if use wildcards, or if the string without wildcards does not match exactly, case included, any of the existing values.  If there are no wildcards and the string matches exactly one of the values, it is case sensitive.

I don't like the result.  Gone drinkin'

maxgro
MVP
MVP

11.20 SR10 64bit

I fully agree with "I don't like the result"

1.jpg

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hmmm, here are my results and some observations:

1. When the value is listed with no quotes, it looks like the search is case-sensitive (column 2 returns 1 value)

2. But, if the search value doesn't exist (such as mET), then the search reverts to not case-sensitive (column 4 returns 4 values)

3. The same happens when either single quotes or double quotes are used.

4. However, if a wildcard like "MET*" is used as a search (see the last column), then the search is not case-sensitive either way.

It smells like a bug. My conclusion - always keep in mind that the search may or may not be case sensitive and ensure proper logic using UPPER, LOWER, or Capitalize.

hic
Former Employee
Former Employee

The logic is:

IF there is a field value that is an exact case-sensitive match THEN

     RETURN this single field value

ELSE

     RETURN all matches you get with a case-insensitive wildcard search

I consider this behaviour to be incorrect, i.e. a bug.

HIC

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

This behavior is, indeed, very annoying. You can get different results almost randomly. If your search string happens to exist in the data, you will get 1 value back. If it doesn't exist, you may get many more other values that match the case-insensitive search.

Don't you think we should make QlikView search more predictable???