9 Replies Latest reply on Feb 24, 2012 8:42 PM by Tim Uckun

    Changing the data source

    Tim Uckun

      I have a lot of workbooks which use similar or same data sources.  I would like to kind of "start over" and create a new data source from scratch and switch all my workbooks to use this one data source. Of course I fully expect to do numerous tweaks on the various workbooks to make them all fit but I think that would be preferable to starting from scratch on all the work books.

       

      What is a good strategy for doing this?

        • 1. Re: Changing the data source
          Ken Patton

          Here's what I do:

           

          1.) Save a copy of the "old" or "source" .twb so there's always a fallback position.

          2.) Save a new copy of the .twb with a new file name also.

          3.) Close Desktop then open only the newly renamed .twb.

          4.) If "Use Extract" is invoked, then uncheck.

          5.) Go to the Worksheet for which I want the same viz style but a different data set / source.

          6.) Edit the Data Connection  and point it to the new data source.

          7.) [Optional] Tweak cosmetics.

           

          -----

          You can also export Bookmark (.tbm) files, but I find that to be a lot of overhead and only works if the data sets are essentially identical in terms of field names with only the values differing.

           

          No warranty is express or implied, other than I've done the procedure as listed.

          • 2. Re: Changing the data source
            Andy Cotgreave

            Do you have Tableau Server? If the workbooks are published to Tableau Server then you have a certain amount of leeway about changing datasources of published workbooks. See page 40 of the server admin guide:

            http://downloads.tableausoftware.com/quickstart/server-guides/server_admin6.0.pdf

             

            If you're not on Tableau Server, there is no supported way to change a whole bunch of Workbooks' data sources in one go - you have to go into each workbook and use the Data...Replace Data Sources menu option for each replacement you need to make.

             

            Workarounds and hacks? Well, there are a couple of options. Maybe you could maintain one data source that is the "live" one. Let's call this DS_Live. Build everything to that connection. As new connections are available, you change the existing DS_Live to DS_Not_Live (or something like that) and promote the newer connection to DS_Live.

             

            The final option is an unsupported hack and is at your own risk. TWB files are XML - so it is possible to parse the XML text, find where the connection is defined, and replace it with the new connection info. I did this as a customer, and I believe others have created scripts to automate this across a bunch of workbooks. However - I must emphasise that you're on your own with this one! Tableau Support won't help you (but somepeople on the forum might!

             

            Good luck

            Andy

            • 3. Re: Changing the data source
              Alex Kerin

              Yeah, I do this the whole time. As do of 4 of my peers. Inevitably I sometimes screw up and use an extract from a different data source, or change the data source, but keep the wrong extract and screw up that extract.

               

              It would be great if we could define a workbook to only look at datasources local to the workbook, and disregard any files elsewhere. In fact, I have an an entry in the idea forum around just that....

              • 4. Re: Changing the data source

                Hi Tim,

                 

                Although it seems cumbersome, this worked for me.  I am working in 6.0. Not sure if this would affect or not.

                 

                Allyson

                 

                http://kb.tableausoftware.com/articles/knowledgebase/replacing-data-source

                • 5. Re: Changing the data source
                  Gavin Olmstead

                  I'm trying to re-point a bunch of dashboards over to a Tableau Server data connection (and thus share an extract). 

                   

                  When I follow the directions and replace the data source with the Tableau Server Published Connection.  I keep getting a bunch of "An error occurred while communicating with the data source": "no such column [field]".  But these columns do exist in both data sets, have the same name, and the same calculated field formulas.

                   

                  Is anyone else running into this?  It seems to be an issue just for the calculated field columns.

                  • 6. Re: Changing the data source
                    Ken Patton

                    Did you Optimize the Extract before publishing the Extract to the server?  Optimize is the option that writes the Calculated Field into the Extract. That said, it seems like your new .twb could just do the calculations itself.

                    • 7. Re: Changing the data source
                      Gavin Olmstead

                      Thanks Ken.  The extract is optimized.  It's definitely true that I can do the calculations within the worksheet, but I thought that a selling feature of the data server is to be able to share calculated fields with other users (and validate that they are correct). 

                       

                      I have 20+ dashboards sharing similar connections.  I'd hate to have to manage all of those calculated fields independently.  Or rebuild them all...

                      • 8. Re: Changing the data source
                        Ken Patton

                        Yeah I'd like to think that what you are encountering is a bug, or confluence of bugs -- rather than a "working as designed."

                         

                        So far I have found 7.0 Extracts to be less robust than those of 6.x , but there's no going back now.

                        • 9. Re: Changing the data source
                          Tim Uckun

                          Thanks for the strategy guys. I'll try them out and see what happens.

                           

                          BTW with Tableau Seven what is the best strategy dealing with complex data sources?

                           

                          I have a postgres database and my current solution is to create a view and have tableau extract the data from that view. I then create any calculations and such on top of that. The view has half a dozen or so tables in it and it has a lot of records (millions). Since I don't necessarily need every table in every vis I am wondering if it makes more sense to create each table as a tableau data source and then add the ones I need to each viz and have tableau link them together.

                           

                          Any advice on that?