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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Digvijay_Singh

Set Analysis - is it case insensitive ?

I think I am missing some basics here but I thought I should get opinion here. I was going through one of the post in community and was trying to create sample like below but came across something looks silly but I think I am missing something in understanding it properly - 

See the details below.

When I used below script -

LOAD * INLINE [

    Flag Field, Status, Field A, Field B, Product ID

    2, ACTIVE, Red, Color, 1

    2, ACTIVE, BLUE, Curve, 2

    1, DEACTIVATED, RED, Curve, 3

    2, ACTIVE, Blue, Curve, 4

];

The output is like below -

output1.PNG

When I changed the case of Field A value -

LOAD * INLINE [

    Flag Field, Status, Field A, Field B, Product ID

    2, ACTIVE, Red, Color, 1

    2, ACTIVE, BLUE, Curve, 2

    1, DEACTIVATED, RED, Curve, 3

    2, ACTIVE, BLUE, Curve, 4

];

The output is as below -

Output2.PNG

When both values made to lowercase -

LOAD * INLINE [

    Flag Field, Status, Field A, Field B, Product ID

    2, ACTIVE, Red, Color, 1

    2, ACTIVE, Blue, Curve, 2

    1, DEACTIVATED, RED, Curve, 3

    2, ACTIVE, Blue, Curve, 4

];

Output is same -

output3.PNG

14 Replies
hic
Former Employee
Former Employee

This is a known bug that unfortunately hasn't been fixed yet. I haven't described it in my blog posts, since it is a bug. It has nothing to do with set analysis explicitly, but exists in normal searches too.

The behaviour is the following: If there is a case sensitive perfect match, this match is shown - and nothing else is shown. This means that if you have a field value 'BLUE' and the search string is upper case, this value will be shown. But 'Blue' and 'blue' will not. Compare the two pictures below where one field value contains an asterisk, and you'll see.

Image1.png Image2.png

HIC

Digvijay_Singh
Author

Dear hic‌,

Thanks for your response. So I suppose it is better to use upper or lower to ensure consistency of output for string related comparisons in set analysis. I wonder why count(if()) works properly, is it not using the same algorithm for string comparisons like we use in search/set analysis?

Regards,

Digvijay

swuehl
MVP
MVP

How do you want to use upper() and lower() here in the set modifier?

I think you can get consistent results (set analysis vs. count(if()) ) when you perform a search like this:

=count({<FieldA = {"=FieldA='Blue'"} >} Flag)

Not really a nice and intuitive solution, though.

Digvijay_Singh
Author

Right! No way I could find to transform field data to upper/lower and then compare in set analysis, it needs to be corrected during loading only.

I tried your expression and I think it seems the only way where if and set analysis started giving same results.

I am closing this thread now based on the limitations we understood and your suggested way to keep set analysis case sensitive!

Thanks to all for spending time on this.

hic
Former Employee
Former Employee

No, QlikView and Qlik Sense searches are not case sensitive.

My previous comment in this thread explains it. It is a bug that searches only sometimes (very rarely) revert to being case sensitive, but in most cases they work correctly: case insensitive.

Literal string comparisons are however case sensitive. This is why Count(If(...)) and swuehl 's solution work fine.

HIC