Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
You could include such condition in an expression within a set analysis like:
sum({< B = p(B), A = >} Value)
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
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.