Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 -
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 -
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 -
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.
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.
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
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.
I don't think any problem. Can you let us know which expression is giving wrong result?
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.
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.
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
Max, it seems as you said for Case1 and 2
Also
Case 3: with *, case insensitive
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.