When creating workbooks that will have future iterations (i.e. not one-time, static infographics), there may come a time when you have to either refresh the data in your dashboard or replace is with another data source.
In the ideal scenario, especially if you have your workbook on Tableau Server, your workbook would be connected to a live data source and you would just update your data source (without changing the name of the data source or field names) and your workbook would update automatically. No problems.
However, sometimes you will have to replace the original data source with a new one. If for whatever reason you cannot update or refresh a live data source connected to your workbook, there are some things you need to bear in mind.
The usual process to replace a data source is as follows: open your workbook, click the add data source icon, add the new data source, and then replace your original data source:
- Add new data source
- Right click on original data source, select “Replace data source”
- Add new data source
- Replace with new data source
If the new data source has EXACTLY the same field names, you should generally be fine. However, if anything has changed, even if it’s just removing a hyphen or changing a field so that it’s capitalised, you will break a few things.
For example, let’s say you build a dashboard with an initial data source (in my case, Sample Superstore). Then you decide that you need to replace the data source and for whatever reason (maybe a different person pulled the data this time, maybe the fields were renamed as part of a new policy, maybe you wore the wrong kind of socks that morning, whatever the case may be), some of the fields were renamed. For this example, I’ve renamed Category as category and Subcategory as subcat.
The first thing you will notice when you replace the data source is that your fields that were renamed now have a red ! exclamation mark next to them. This is because Tableau thinks the fields are no longer in the data. To fix this, you just right click on the field, select replace references, and point it to the new renamed field:
This is where the break happens:
This is my dashboard before I replace my data source
This is my dashboard after I replace my data source
What has changed? Well there are a couple of things:
- Colour: The most obvious change is the colour that I had initially used for my different categories. When you replace your data source with new field names, Tableau will revert to its default colour scheme
- Legend arrangement: In addition to the colour change, Tableau has also rearranged my legend so it is no longer a single row
- Default sort: My sales by subcategory initially had a default sort that put technology at the top. Tableau has reverted to an alphabetical sort
- Aliases: If you look at the Segment Profitability bars, you’ll notice that the bar that was initially called “Self-Employed” has reverted to its original non-alias, “Home Office”
- Although it didn’t change in this instance, I have seen “Grand Total” fields disappear. In my own experience, I’ve typically seen it happen with Grand Total columns that sum up your rows, but be mindful of this as well if you have Grand Total rows that some up your columns
When you replace your data sources, make sure you pay attention to the potential changes outlined above. Some other areas to pay attention to are sets, the format of quick filters on your dashboard, and groups. In light of all these loose ends, it’s best to avoid having to replace data sources entirely and just connect your workbook to a live data source that is updated via Tableau Server. It will save a lot of time on maintaining and updating your dashboards.