1 Reply Latest reply on Sep 2, 2018 11:38 AM by Shinichiro Murakami

    Filter primary and secondary

    Daniel Vacca

      Hello community,

       

      I have been trying to implement the following in Tableau but have not been able to. I hope you can give me a hand.

       

      I have two datasources A and B which share two sets of columns, Cols1 and Cols2. My goal is to apply some user filters on the values of Cols2 on both A and B, and then filter out the rows in A that do not match with any row in B according to Cols1. Let me give you an example:

       

      Datasource A

       

      Col1

      Col2

      Col3

      1

      a

      !

      2

      b

      #

      2

      a

      $

      3

      b

      %

       

      Datasource B

       

      Col1

      Col2

      Col4

      1

      a

      &

      2

      b

      /

      2

      c

      ()

      5

      b

      ?

       

      Col1 is the “join” column (the column to match rows from A to B) and Col2 is the user filter column.

      Without any filters on Col2, my expected output is:

       

      Col1

      Col2

      Col3

      1

      a

      !

      2

      b

      #

      2

      a

      $

       

      If I set the filter to Col2=a, the output should be:

       

      Col1

      Col2

      Col3

      1

      a

      !

       

      Note that no rows with Col1=2 are obtained; the filter rules out such rows in B so that no match can be found from A.

       

      If I set Col2=b, the output should be

       

      Col1

      Col2

      Col3

      2

      b

      #

       

      Note that the row with Col1=3 passes this filter but has no match in B so it is not part of the output.

       

      When Col2=c, the output is empty as no rows in A pass the filter.

       

       

      So far I have implemented the second part with data blending by using A as primary, B as secondary and Cols1 in the relationship. However, I have not found any solution for the other part.

       

      Just some additional comments:

      - I want a single view with data from A filtered according to the rules I have explained above

      - I do not want to have two different filters for the columns from each datasource because the user would always have to repeat the same selection twice. Furthermore, if the user forgets to do so then the selected values for the same column do not coincide in both datasources, and calculated fields from A might be wrong.

      - Cols2 are just for filtering both datasources, I do not care about their values when blending.

      - I want filters to allow multiple selection, so the solutions I found using parameters might not do.

       

      If you need any further clarification just let me know.

       

      Thanks.

       

      --

      EDIT:

      In reply to Shinichiro Murakami, I have defined what should happen when you select Col2=b or Col2=c.

      I have also posted the original requirement that I should implement. Hope it helps.