5 Replies Latest reply on Nov 3, 2016 8:58 AM by Santiago Sanchez

    How to automate "pivot" step?

    Ruofei Wang

      I'm trying to automate my report. But I have to pivot my data source at first. How can I automate it in Tableau? Thanks!

       

        • 1. Re: How to automate "pivot" step?
          Santiago Sanchez

          Hi Ruofei,

           

          I assume the problem is you need to get data from a new file. If that's the case, have you tried to point the data connection (which you've already Pivoted) to a different file? I believe the Pivot will stay. Which means, if you schedule a refresh for an already pivoted data source, you don't need to pivot again as Tableau will take care of it automatically.

           

          Let me know how it goes. Hope this helps.

          • 2. Re: How to automate "pivot" step?
            Ruofei Wang

            Hi Santiago,

             

            Thanks. My problem is that for every data source, I have to pivot it in the "data source tab" before it goes into the workbook. Is there any solution for it?

            • 3. Re: How to automate "pivot" step?
              Santiago Sanchez

              Can you be more descriptive please? I'm confused with what you mean with 'every data source' and 'automate'. Perhaps if you attach an example we can figure something out,

              • 4. Re: How to automate "pivot" step?
                Ruofei Wang

                Sure. Here is the scenario:

                 

                First day:

                new data source: file1.csv -> pivot some of the columns -> go to the workbook -> replace the old data source as file1.csv

                 

                Second day:

                new data source: file2.csv -> pivot some of the columns -> go to the workbook -> replace the old data source as file2.csv

                 

                Third day:

                the same repeat...

                 

                basically, file1 and file2 has the same data structure and I need to pivot the same columns every time.

                • 5. Re: How to automate "pivot" step?
                  Santiago Sanchez

                  Thanks, Ruofei! Here's an alternative... This one will save you the pivot step, although you'd still have to do this 'manually' from Tableau Desktop. Instead of replacing one data source with another, you can just update the connection to use the new file:

                   

                   

                  If you do this, you don't need to pivot everytime, as the connection is the same and persists this instruction.

                   

                  Are you using Tableau Server or Online as well?