1 Reply Latest reply on Nov 14, 2018 7:51 AM by Paul Wachtler

    How Can I Create a Parameter to Select Items to Place on the Row Shelf?

    Stephen Hellyar

      I have a parameter that controls what goes on the Row Shelf.  It changes out the dimension on the Row Shelf.

       

      It currently reads ...

      Ignore any typos.  This is not a cut and paste.  It works in the real-world.

       

      CASE [Pick Columns]

           When 'Dimension 1' then [Dimension 1]

           When 'Dimension 2' then [Dimension 2]

           When 'Dimension 3' then [Dimension 3]

           When 'Dimension 4' then [Dimension 4]

           Else 'None'

      END

       

      I need to adapt it to a dimensions that are part of hierarchy.   I know a user can use the hover over to expand/collapse the hierarchy.  But, you have to know it is there.  Some users might not know it's there.   So, I want to use a parameter to create a high visibility way of expanding/collapsing the hierarchy.  

       

      This is not the correct expression.  But, this is what I am trying to do...

       

      CASE [Pick Columns]

           When 'Level 1' then [Level 1]

           When 'Level 2' then [Level 1] and [Level 2]

           When 'Level 3' then [Level 1] and [Level 2] and [Level 3]

           Else 'None'

      END

        • 1. Re: How Can I Create a Parameter to Select Items to Place on the Row Shelf?
          Paul Wachtler

          Hi Stephen,

           

          Tableau can return a calculated field that concatenates the hierarchy field values for you (eg. if you hierarchy was country > state > city, it could return "USA, FL, Miami" in one field).  However if you want to return three separate fields for each level in the hiearchy, then you'll need three calculated fields.

           

          To describe what you're asking for, you could set up three calculated fields like this:

          Field 1 (I assume this will always be shown so no logic needed here - you could even simply use your level 1 field)

          [Level 1]

           

          Field 2:

          if [Pick Columns] = 'Level 2' or if [Pick Columns] = 'Level 3' then [Level 2] end

           

          Field 3:

          if [Pick Columns] = 'Level 3' then [Level 3] end

           

          You can then add each field to your rows or columns shelf.

           

          Best,

          Paul