Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

comparing two string variables

Hi experts,

can you please let me know how to compare string variables in qlikview UI. For example I have two variables A and B

with below values

 

AB
A1234A1234
A5678A5675
A8901A5432

I want to get distinct count after combining these values which is 5. Please help.

Thanks,

3 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Change your script like below

Data:

LOAD

*,

A & '|' & B AS Key

INLINE [

A, B

A1234, A1234

A5678, A5675

A8901, A5432];

SplitValues:

LOAD

Key,

SubField(Key, '|') AS CountField

RESIDENT Data;

Now use below expression to get distinct Count

=Count(DISTINCT CountField)


Hope it helps you.


Regards,

Jagan.

Not applicable
Author

Hi Jagan Mohan,

Thanks for response I don't want logic in script, it needs to be in UI variables is based on complex condition and derived in UI. Please help. Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

My suggestion is to do this in script, it is the best practice.  If it is complicated then use below expression

=Count(DISTINCT A) + Count(DISTINCT B) - Count({<A=P(B)>}  DISTINCT A)

Regards,

Jagan.