14 Replies Latest reply on Aug 17, 2018 11:54 AM by Shinichiro Murakami

    Filter based on another filter

    Ravit Thapar

      Hi Tableau Community,

       

      I am trying to implement a capability to create a filter based on the values in another filter but I didn't have any luck so far and so I am reaching to the Community for help!

       

      I've attached a sample workbook with some sample data.

       

      High-level expectation:

      There are two filters - "In Group" and "Out Group". These are based on whether a person has a Group Code assigned or not.

      I need to compare cost and savings between persons of "In Group" with their "Out Group" counterparts. As per the sample data in this workbook,

      • A person named, M1 (Column: "Name") has a Group Code 1212 and his group code matches with the PP Code (1212) of M2, M3, M4 (who are not in any group). So I need to compare how much M1 is saving in comparison to M2/M3/M4 by being in the Group 1212.
      • Similary, M5 has a Group Code 1818 and his group code matches with the PP Code (1818) of M6, M7 (who are not in any group). So I need to compare how much M5 is saving in comparison to M6/M7 by being in the Group 1818.

       

      On "Dashboard 1":

       

      # Task1: (Sheets 1 and 2)

      Using filter "In Group", I need to reflect appropriate values in "Out Group" filter based on "Group Code" and "PP Code". That means, as per this sample data, if "M1" is selected in filter "In Group" (Group Code: 1212) then "M2", "M3" and "M4" (PP code: 1212) should only be the values available in the drop-down of filter "Out Group".

      Similarly, based on the value selection in the filter "Out Group", I need to get corresponding values in filters "PP Code" and "DD Code" for the selected Out Group. For example, if "M2" is selected in "Out Group" filter, then "PP Code" filter will have value 1212 and "DD Code" filter will have values (A135, A136, A123, A124).

       

      # Task2: (Sheet 3)

      Once I have the above Task1 completed, I need to compare the "Amount" and calculate "Savings" (difference of Amounts) for the above selected members.

      For example, if "M1" is selected in filter "In Group" and "M2" is selected in filter "Out Group", then I need to create a bar graph (hard coded in Sheet 3 for now) with their SUM(Amount) values (M1 = 1600, M2 = 4000). The Savings = (4000 - 1600) = 2400 would be displayed adjacent to the graph.

       

      I'd really appreciate any help, thoughts and/or work-around to achieve the above.

       

      Thank you!!