1 2 Previous Next 17 Replies Latest reply on Jun 26, 2017 11:20 PM by Carol Kong

    Change data source without destroying the formatting

    David Joedicke

      Hi all,

       

      I want to change the data source of a project I have. Unfortunately all my formatting (aliases etc.) has disappearde afterwards.

      Is there any chance to change the data source without destroying my personal formatting?

       

      Thanks,

       

      David

        • 1. Re: Change data source without destroying the formatting
          Shawn Wallwork

          Not that I know of, and yes this is an irritating "feature". But there's a rumor that T is working on over hauling formatting altogether.

           

          Shawn

          • 2. Re: Change data source without destroying the formatting
            Budy Sugianto

            Depends on your needs, I think you need to change your Tableau data source to use another database or file (e.g excel). And of course we don't want to lose all of our works on data perspective. And must be assumed another database or file has exact the same data set structure (column name, data type)

            To do that you need to edit the connection of the Tableau data source, change to other database/server (or browse to another excel file).

             

            If the data source or workbook already publish to server, there is an option to change the data connection to other database/server.

            • 3. Re: Change data source without destroying the formatting
              Shawn Wallwork

              8.1? Nah. It'll be 9.0 at best.

               

              --Shawn

              • 4. Re: Change data source without destroying the formatting
                Budy Sugianto

                Nope. The feature is already there for a long-long time

                • 5. Re: Change data source without destroying the formatting
                  Jonathan Drummey

                  Here's a hacky solution that is minimally tested. It requires doing a little XML editing of the .twb file and is not supported by Tableau, and if it blows up and you point a finger at me I'll be off whistling "Somewhere Over the Rainbow" and trying to look innocent.

                   

                  On the good side, the .twb doesn't actually include references to the columns of the original data source unless they are somehow customized or are used in a worksheet, so the new data source could have fewer or additional fields without trouble. However, I can imagine issues with wildly different data sources.

                   

                  0. Close Tableau.

                  1. Back up your workbook.

                  2. Seriously, back up your workbook.

                  3. Open Tableau and create a new workbook with a data connection to the new data source.

                  4. Save and close that as a .twb, we'll call it "temp.twb".

                  5. Open up temp.twb file in Notepad or another text editor.

                  6. Copy the <connection ...> tag (it's a few lines of details) to the clipboard.

                  7. Open up your original .twb file in Notepad or another text editor.

                  8. Find the <connection ...> tag that correposonds to the data source you want to replace.

                  9. Paste in the new connection over the old connection.

                  10. Save the original .twb.

                  11. Open the original .twb in Tableau. Everything should be working again.

                   

                  You can also do something like this with the underlying connection within Tableau saved data sources by editing the .TDS files.

                   

                  Jonathan

                  9 of 9 people found this helpful
                  • 6. Re: Change data source without destroying the formatting
                    Allan Walker

                    We've been able to go "backwards" by hacking the xml, i.e. open a "8" workbook in "7".  It's pretty easy, just create the same file side-by-side - the differences are quite easy to spot and edit

                    • 7. Re: Change data source without destroying the formatting
                      David Joedicke

                      Jonathan,

                       

                      this seems to work really good! I did not check it in detail but on a first look, perfect!

                      Thanks a lot.

                       

                      Best

                       

                      David

                      • 8. Re: Change data source without destroying the formatting
                        Stefano Pistillo

                        Jonathan Drummey,


                        I tried your solution and it worked great, with an additional step.

                        I just wanted to add that doing a copy and past of the <connection> section wasn't enough.

                        We are using CSV files on Tableau server as data source and as an additional step, I had to find and replace the name of the old data source with the new one, as it was mentioned repeatedly over the file.

                        Of course the new data source included the old field names.

                        This finally solved everything and we got a workbook with old formatting, content, formulas, etc and new data source.


                        Thanks for sharing useful tips,

                        Stefano

                        1 of 1 people found this helpful
                        • 9. Re: Change data source without destroying the formatting
                          Fred Oko

                          Is hacking the XML still the only/best way? I've done similar for one-offs in the past and they worked but we are in the position of swapping out an entire history of connections (Vertica to Redshift) and while we could perhaps create some batch process around this hack it would be much preferable if this was cleanly supported -- either by adding the ability to also change Connection Type in the Server Data Connections administration view or via some other API (though we don't really want to rebuild all our extracts from scratch even using the Extract API perhaps a framework like that makes us more flexible to overcome this functionality deficiency). It almost seems as if someone must have started selling a product for this gap by now though ultimately Tableau does need to rethink their entire data model to be more abstracted to allow seamless connection type changes.

                           

                          Additionally while our schema is an exact match except for some minor variation in supported types between the DBs we do recognize the handful of incompatibility cases would need to be resolved manually w/o some automated test and verify functionality as well.

                          • 10. Re: Change data source without destroying the formatting
                            Eva Murray

                            Exactly what I needed today and works perfectly fine.

                            Saves me at least half a day of formatting, if not more.

                             

                            Thanks Jonathan Drummey

                            • 11. Re: Change data source without destroying the formatting
                              Ekaterina Noykhovich

                              Does this still work? I tried to replace the connection using your instructions, but then when I open up the original (step11), the calculated fields, filters, etc carried over, but the dashboard and sheets are blank. They're not being filled with the new data. Is there another step I'm missing? Thank you in advance!!

                              • 12. Re: Change data source without destroying the formatting
                                khaja mohiuddin

                                Hi,

                                    Everyone. I have a question for replacing a data source. when I am changing data source its changing color alias everything.. I am using CSV File as a data source

                                I have tried this method  ==>

                                0. Close Tableau.

                                1. Back up your workbook.

                                2. Seriously, back up your workbook.

                                3. Open Tableau and create a new workbook with a data connection to the new data source.

                                4. Save and close that as a .twb, we'll call it "temp.twb".

                                5. Open up temp.twb file in Notepad or another text editor.

                                6. Copy the <connection ...> tag (it's a few lines of details) to the clipboard.

                                7. Open up your original .twb file in Notepad or another text editor.

                                8. Find the <connection ...> tag that correposonds to the data source you want to replace.

                                9. Paste in the new connection over the old connection.

                                10. Save the original .twb.

                                11. Open the original .twb in Tableau. Everything should be working again.

                                 

                                But  don't know from  where to start copying the connection details and where do end ? plz  help me out

                                • 13. Re: Change data source without destroying the formatting
                                  sam.xia.2

                                  Start copying from "<connection" and end at the row with "</connection>"

                                  1 of 1 people found this helpful
                                  1 2 Previous Next