1 Reply Latest reply on Apr 6, 2016 5:40 PM by Esther Aller

    How to show/hide a dimension using parameter?

    Matan Bracha

      Hi All!

      I'm having a bit of an issue - I've created a calculated field that shows a different dimension according to a parameter.

      Meaning:

      1. Parameter "Group Switch", List: Product Name, Publisher Name, Country Code.

      2. Calculated field "Group Switch Calculation":

      CASE [Group Switch]

      WHEN 'Product Name' THEN [Product Name]

      WHEN 'Publisher Name' THEN [Publisher Name]

      WHEN 'Country Code' THEN [Country Code]

      END

       

      Now, the field "Product Name" has a hierarchy that I've built in tableau - but when I choose it, I see only the Product dimension without the option to drill-down the hierarchy...

       

      Is there any way to make the hierarchy show even when using a calculated field to show the dimension?

      Or maybe a convenient work-around?

       

      I also thought about showing/hiding the dimensions according to the parameter (when you choose A I'll hide B, and the other way around) - Is that possible?

       

      Any help would be much appreciated - Thank You!

        • 1. Re: How to show/hide a dimension using parameter?
          Esther Aller

          Hey Matan,

           

          The [Group Switch Calculation] would need to be in the hierarchy in order for the drill down/up option to show in the view. However if the calculated field is placed in the hierarchy then the drill up/down options will appear no matter what the user has selected.

           

          It is possible to create a calculated field that will only show values for [B] when the user chooses "A" with something like:

           

          IF [Group Switch] = "A"

          THEN [B]

          END

           

          The downside is that when the user chooses something other than "A" then the above column will display NULL values rather than being removed from the view. Currently there is no way to dynamically hide a column from the view based on the contents of the column.

           

          I hope this helps!