Replace Data Sources
There are times when you may want to update a workbook or sheet to use a different data source. Rather than rebuild your workbook using a new data source, you can replace the data source.
Tip: All sheets that use the data source will be updated when a data source is replaced. If you wish to replace the data source for a single sheet, you’ll need to use a workaround. (1) Copy the sheet to a new workbook and delete it from the old workbook. (2) In the new workbook, replace the data source. (2) Copy the sheet back to the original workbook. The data source and all relevant items for the sheet such as parameters and sets will be copied as well. For more information, see Copy and paste sheets between workbooks.
Replacing a data source does not merge or edit the data sources. Rather, replacing a data source simply redirects fields used in the worksheet to map to corresponding fields in the new data source. Any fields that the user creates in the original data source (for example, calculated fields, groups, sets, etc.), that are included in the view are successfully copied over to the new data source. Fields that are not included in the view that don't exist in the new data source are not automatically copied and will need to be manually copied and pasted to the new data source before replacing the old one.
The two data sources do not have to be identical, however, any differences between the workbooks will affect the sheets in the workbook and the fields in the view. More specifically, any fields, groups, sets, and calculated fields that do not exist in the new data source (or have a different name) are removed from the Data pane. For more information about how to replace field references to fix invalid fields, see Edit Data Sources.
Open a workbook that connects to the original data source.
Select Data > New Data Source and then connect to the new data source.
On the Data Source page, drag a table to the canvas to set up the data source (if this is not automatically done for you).
Go to the sheet tab and select Data > Replace Data Source.
Note: You must have at least one field in the view to make the Replace Data Source option available.
In the Replace Data Source dialog box, select the Current data source and the Replacement data source.
When finished, click OK.
All worksheets, dashboards, and stories that used the original data source are updated to use the new data source. You can click Undo on the toolbar to revert the change and return to the original data source.
You can only replace one data source with another data source when both data sources are relational data sources, or when both data sources are cube (multidimensional) data sources. In Tableau, cube data sources are supported for Windows only.
Published data sources
When you publish a data source from a workbook, the current workbook in Tableau Desktop will automatically connect to the published data source, and automatically close the local data source. So it is not necessary to replace the data source when you publish a data source. For more information, see Publish a Data Source.
In addition, replacing a data source is not currently available for web authoring in Tableau Online or Tableau Server.