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

1 Solution

Accepted Solutions
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.

View solution in original post

14 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Qlikview is case sensitive so BLUE is not equal to Blue, so which loading you can format the values by using either Upper(), Lower() or Capitalize(). 

Even in set analysis also it is case sensitive.

Regards,

Jagan.

Anonymous
Not applicable

Hi,

yes,Qlikview is case sensitive so BLUE  and Blue values are not same,once inline tables are loaded,

Check FieldA filter in UI and you see two different values(BLUE  and Blue),while loading you format the

values by using either Uppercase(), Lowercase()  or Capitalize() and not with mixed cases else you get duplicate values.

so its same in set analysis also it is case sensitive.

if you have duplicate values same like these scenario,you need to  do data cleanse in the script.

Same goes with data from different data sources.request your DB team to do data cleansing or else

you can do your self with if statement or Applymap functionality

Regards

Neetha

Digvijay_Singh
Author

Thanks Jagan for the response. I was wondering why if(count) and set analysis is giving different output? If you see middle one output, Set analysis should output 0 but it is showing 2 as count.

MK_QSL
MVP
MVP

I don't think any problem. Can you let us know which expression is giving wrong result?

Anonymous
Not applicable

Digviya,  Great if you could post the expressions as text, for copy and pasting.  I know they are not that long, but I am feeling lazy today.

Digvijay_Singh
Author

Expressions are -

=count(distinct if([Flag Field]<> 1 and [Status]='ACTIVE'

and [Field A]='Blue' and [Field B]<>'Plain' and [Field B]<>'Color'

,[Product ID]))

=count({<[Flag Field]-={1},

[Status]={'ACTIVE'},[Field A]={'Blue'},[Field B]-={'Plain','Color'}>}

Distinct [Product ID])

'If' is generating correct results I feel but SET is not showing correct results when Field A values are changed with different case in script, please keep in mind I am not changing anything else except the script value for Field A. I am not making any change in expressions for all three cases.

PrashantSangle

Hi,

As per my understanding of Set Analysis

when you comparing a field value in Set Analysis then Set Analysis work in 2 cases:

Case 1: It will compare the field value with Case sensitve.

Case 2 : If case 1 fails then field value compare with in-case Sensitive

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
maxgro
MVP
MVP

Max, it seems as you said for Case1 and 2

Also

Case 3: with *, case insensitive

2.png

swuehl
MVP
MVP

There is also this discussion

Case sensitive problem in Set-Analysis

(with no solution).

hic mentioned that QV will currently not distinguish between single and double quotes in set modifier, but he considers this as a bug that may be fixed in the future.

As above shows, it's true that there is no difference between single and double quotes, but case sensitivity / insensitivity seems to be more complex than described in his answer.