6 Replies Latest reply on Jun 11, 2018 7:33 AM by Stephen Groff

    Filter Results Based on Dimension using Parameter

    Stephen Groff

      Greetings Tableau Experts,

       

      I'm trying to figure out how I can create a parameter to show my Assembly Data vs. My Facility Data.

       

      However, I'm having trouble with the calculation that will auto filter my results.

       

      My parameter (Assembly/Facility) has 2 selections in my custom list to choose from: Assembly or Facility

       

      My dimension [Cause Group] contains within it all our particular facility areas (Assembly, Fabrication, Sub Assembly, Rework, etc.)

       

      What I'm trying to get at is... When I select "Assembly" from the parameter, I want to only see results from [Cause Group]="Assembly"

       

      My current calculation is:

       

      CASE [Assembly/Facility]

      WHEN "Assembly" THEN [Cause Group]="Assembly" END

       

      I'm missing a crucial step here because nothing changes when I select either.  Is there a way to filter results using a parameter based on a dimension?

       

      Attached a dummy extract

      .Events# is the parameter calc.

        • 1. Re: Filter Results Based on Dimension using Parameter
          joy.delosreyes

          Attachment?

          1 of 1 people found this helpful
          • 2. Re: Filter Results Based on Dimension using Parameter
            Stephen Groff

            Sorry, I was certain I attached it.  Apparently not

            • 3. Re: Filter Results Based on Dimension using Parameter
              joy.delosreyes

              Hi, sorry I really don't understand where did you get Facility.

              In cause group, you only have "assembly".

              So I created a calculated field: [Calculation1]

               

              IF [Cause Group] = "Assembly" THEN "Assembly"

              ELSEIF [Cause Group] = "Design Engrg" THEN "Facility"

              ELSEIF [Cause Group] = "External Supplier" THEN "Facility"

              ELSEIF [Cause Group] = "Fabrication" THEN "Facility"

              ELSEIF [Cause Group] = "Material Handling" THEN "Facility"

              ELSEIF [Cause Group] = "Production Control" THEN "Facility"

              ELSEIF [Cause Group] = "Inspection" THEN "Facility"

              ELSEIF [Cause Group] = "Supply Chain" THEN "Facility"

              ELSEIF [Cause Group] = "Unknown" THEN "Facility"

              ELSE [Cause Group]

              END

               

              This is to group "cause group" to Assembly and Facility

               

              Then create another calculated field: [Calculation2]

              CASE [Assembly/Facility]

              WHEN "Assembly" THEN [Calculation1] = "Assembly"

              WHEN "Facility" THEN [Calculation1] = "Facility"

              END

               

              Put [Calculation1] in rows

              [Calculation2] = True

              1 of 1 people found this helpful
              • 5. Re: Filter Results Based on Dimension using Parameter
                Stephen Groff

                Joy.

                 

                Quick question.

                 

                I only want "Assembly" cause group to show when selecting "Assembly" from the parameter.  And the way you have the calc setup, this works splendidly.

                 

                However, when choosing "Facility" from the parameter.  I want to include all values from the Cause Group, ([Cause Group]=*All Possibilities*).  Your calculation leaves out "Assembly".

                 

                So when select "Facility", you see everything (including Assembly), and when you select "Assembly" it's only looking at [Cause Group]="Assembly"

                 

                I've adjust the calc to the following, but neither solution seems to work:

                 

                Try1:

                IF [Cause Group] = "Assembly" THEN "Assembly"

                ELSEIF [Cause Group] = "Design Engrg" THEN "Facility"

                ELSEIF [Cause Group] = "External Supplier" THEN "Facility"

                ELSEIF [Cause Group] = "Fabrication" THEN "Facility"

                ELSEIF [Cause Group] = "Material Handling" THEN "Facility"

                ELSEIF [Cause Group] = "Production Control" THEN "Facility"

                ELSEIF [Cause Group] = "Inspection" THEN "Facility"

                ELSEIF [Cause Group] = "Supply Chain" THEN "Facility"

                ELSEIF [Cause Group] = "Unknown" THEN "Facility"

                ELSEIF [Cause Group] = "Assembly" THEN "Facility"

                ELSE [Cause Group]

                END

                 

                Try2:

                IF [Cause Group] = "Assembly" THEN "Assembly"

                ELSE [Cause Group]

                END

                 

                 

                Ideas?

                1 of 1 people found this helpful
                • 6. Re: Filter Results Based on Dimension using Parameter
                  Stephen Groff

                  I got it figured out.  However, I don't think I would've wrapped my head around it without your help.  So thank you.

                   

                  I created a set with all Cause Groups.  Then wrote out a calc as such:

                   

                  CASE [Assembly.Facility]

                      WHEN "Assembly" THEN [Cause Group]="Assembly"

                      WHEN "Facility" THEN [All Cause Groups]

                  END