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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
felio
Contributor
Contributor

Filter based on 2 coupled columns

Hello everyone,

I am trying build a filter that enables users to filter with a selector based on 1 column but results depending on 2 columns.

In mathematical terms: Assuming there is a table with two columns A, B and rows 1 to n. Now, if the end users chooses to filter based on column A and selected value x I want all rows to remain where either:
1. rows i where a_i = x
2. rows i where there is a row j such that (b_i = b_j  and a_j =  x)

With an example:

A B
13 circle
13 square
19 circle
19 heptagon


Now, after 'weakly' filtering based on A and 13 the desired result would be:

A B
13 circle
13 square
19 circle


Is there any way to do this in Qlik Sense? 

Many Thanks

Labels (4)
3 Replies
marcus_sommer

You could include such condition in an expression within a set analysis like:

sum({< B = p(B), A = >} Value)

Aasir
Creator III
Creator III

Using set analysis & applying filters

{<A = {"$(=GetFieldSelections(A))"} >} // Filter based on selected value in column A
+
{<B = {"$(=Concat(DISTINCT B, ', '))"} >} // Filter based on associated values in column B

felio
Contributor
Contributor
Author

Thanks to both of you for your replies. I ended up with a solution based on both of your proposals.
By adding a 3rd column with the measure

Concat(distinct {< B = p(B), A = >}B)

I got the desired result.