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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparison of two fields

Hi,

I have two different fields which are completely independent. When I click in field one at the value 'A' there should be a field function which excludes the value 'A' in field Two. Another example when I click in the field One on the value B and C, in field Two there must selected everything.

How can i achive that?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe


=If(GetSelectedCount(One) > 0, '(' & Concat(DISTINCT {1<Two -= P(One)>} Two, '|') & ')')

View solution in original post

10 Replies
swuehl
MVP
MVP

In general, using field event trigger and selection - select in field actions (go to Settings - Document properties - Triggers).

Your logic is not really clear, could you elaborate on this?

Not applicable
Author

When I choose in field One a Value which is also in field Two,then this value must be excluded in field Two.

One Selection: A      Two: D,E

One Selection: C      Two: A,D,E

One Selection: B,C   Two: A,D,E

Do you understand what I mean?

sunny_talwar

May be like this:

=If(GetSelectedCount(One) > 0, '(' & Concat(DISTINCT {<Two -= P(One)>} Two, '|') & ')')

Mahamed_Qlik
Specialist
Specialist

Hi Hans,

If I am not wrong, then you want as below :

If you select A from One then it should exclude A from Two and rest field should get select (D,E)

If you select C from One then A,D,E should get selected .....and like this

??

Regards,

Mahamed

swuehl
MVP
MVP

Maybe


=If(GetSelectedCount(One) > 0, '(' & Concat(DISTINCT {1<Two -= P(One)>} Two, '|') & ')')

sunny_talwar

Very nice

Not applicable
Author

Okay try following....

1. Select in field One A, you will become the right result

2. Then select in field One B and C and you will see that in field Two the result is only D and E, but normally we must have A,D,E because A in field One is not selectexd

Not applicable
Author

Exactly!

sunny_talwar

I think Stefan was able to fix that issue. Check out his response

Capture.PNG