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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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.