4 Replies Latest reply on Sep 20, 2016 8:49 AM by Sunil Kachappilly

    How to dynamically render columns based on a paramter selection?

    Sunil Kachappilly

      Hi all!

       

      I am pretty sure this question has been asked a thousand times before this.

      However, I am unable to find a good answer anywhere to the problem.

       

      The question is extremely simple.

       

      I have a list report with say 4 columns (Say Country, State, Zip, with the 4th column being some calculated measure).

      I have a parameter with a list of static value selections that lets the user choose the level at which the data is viewed as follows:

      1. Country, State, Zip

      2. Country, State

      3. Country

       

      Depending on the user's choice, I want to simply show or hide the columns in the output.

      A. If the user chooses 1, the output should have 4 columns, Country, State, Zip, Measure

      B. If the user chooses 2, the output should have 3 columns, Country, State, Measure

      C, If the user chooses 2, the output should have 2 columns, Country, Measure

      ......with the measure field aggregated to the respective levels.

       

      I know that this sounds like a very common and simple requirement, but for some reason, I can't find an easy solution.

      Of course, I am new to Tableau.

        • 1. Re: How to dynamically render columns based on a paramter selection?
          Sagar Agarwal

          Hi Sunil,

           

          Please find attached the workbook below with your requirement. I am taking user input via Parameters and then changing the dimensions dynamically based on user selection. I have used the sample superstore data.

          In order to change the column names in your view dynamically, you have to hide the labels in the worksheet and then use Floating text boxes in the dashboard to achieve this. I have also done the same for you.

          Let me know if this is what you are looking for, or you need additional help.

           

           

          Thanks,

          Sagar

          • 2. Re: How to dynamically render columns based on a paramter selection?
            Sunil Kachappilly

            Sagar,

             

            Thanks for the reply.

            Unfortunately, this does not help me.

             

            Though I stated a simple requirement, my idea was to extrapolate that to something complex.

             

            What I truly need is different layouts and aggregation calculations etc.

            I am aware as to how to change calculations, aggregations based on a parameter.

             

            But the layouts that I need to switch based on the parameter needs the ability to completely remove or render columns to give the appearance of layouts being toggled. So just blanking out a column based on a parameter does not help me.

             

            Is it possible to dynamically render or not render columns at all based on a parameter selection?

            Just blanking it out based on parameter selection does not help unfortunately.

             

            OR is not not even possible in Tableau?

             

            A different approach is if I can dynamically switch the worksheet being displayed in a dashboard container based on a parameter.

            Is this possible?

             

            Need help.

            • 3. Re: How to dynamically render columns based on a paramter selection?
              Sagar Agarwal

              Hi Sunil,

               

              I am unable to comprehend your requirement. Do you mean to say, for eg., you have a bar chart on the dashboard, and when someone selects an option from Parameter, the view changes to Pie chart or something else similar?

               

              If this is not what you are looking for, can you please post some screenshots/mockups of what you are looking for. I am new to Tableau too, but what I have learned is that most of the things are possible in Tableau, we need to find the correct workaround

               

              Thanks.

              • 4. Re: How to dynamically render columns based on a paramter selection?
                Sunil Kachappilly

                I've figured out the solution.

                 

                Yes, the need is something similar to what you just stated.

                 

                The solution is to construct the individual worksheets however you want, then apply a filter to the individual worksheets such that the filters will evaluate to FALSE when user makes a selection that needs the worksheet to be hidden (eg: filter condition Parameter = <value> that evaluates to false).

                 

                Then drop all the worksheets and the parameterized filter to the Dashboard. When the user makes selections, the corresponding worksheets blank out completey and it appears as if they are hidden based on user selection.