[Update: A fast solution has been posted
http://vizdiff.blogspot.com/2015/07/replacing-data-source-fast-way.html
]
In my work, after building a workbook based on a data source (a file or a database connection), I extract the data and publish the extract to the server as a data source. By replacing the original data source with the server instance, I find my viz broken.
Actually this breaks everything. As far as I know, the broken pieces include:
- color settings
- aliases
- formats
- quick filters and their settings
- sort orders
- sets
- parameters
- groups
- calculated fields
plus je ne sais quoi.
I am not alone. There are a lot of reports on the subject in the last 3 years:
http://community.tableausoftware.com/thread/151396
Yet a good and elegant solution is to be found.
Here I am trying to analyse the cause, present some workaround and give the ultimate fix to this nagging problem.
The Cause
A viz or a visual app is composed of three main parts:
- data source (the original data set)
- meta data
- rendering (graphing or charting)
Data source and rendering are easy to understand. Then what is meta data or metadata? There are formal and academic definition to it in Wikipedia. In our specific case, the metadata includes everything we manually add on top of the original data. See list above. Metadata could be composite data (such as calculated fields, sets, groups) or annotations (formatting, aliases, properties, colors). Metadata is the value added by us human data analysts. It is the basis for rendering. Simply put, we dream up a Viz, create metadata and instruct machine to do the rendering.
When replacing the original data source, Tableau strangely takes away the metadata with it! Without the metadata, the viz is broken. That's why we need to rebuild all the metadata. How painful!
The Workaround
The workaround consists of two steps. Load the new data source first. Before replacing,
1.Load every worksheet and dashboard by clicking each tab and view the rendering in integrity.
This will preserve annotation part of the metadata: colors, aliases, formats, filter settings etc. See also
http://community.tableausoftware.com/docs/DOC-5359
http://kb.tableau.com/articles/Issue/quick-filters-change-to-multiple-values-list-after-replacing-data-source
2.Copy over composite/derived metadata to the new data source.
See more details in comments below. Hold your control key when copying. This saves you the effort of recreating groups, sets, calculated fields and parameters etc.
After the above two steps, proceed to replace the data source by the new instance. It may or may not fix all your problems because I can't enumerate all the elements that might be broken. Inspect your viz carefully after the replacement.
This should relieve a bit of your pain in migrating data sources. It is still quite painful nonetheless.
The Ultimate Fix
The ultimate fix can only come from Tableau the company. In its current product design, they treat the metadata as part of the data source. That's why when replacing data source, the metadata is gone as well.
In my opinion, the metadata is an integral part of the application and not part of the data source. The metadata must be preserved and retained. In this way, replacing data source won't affect the metadata. The metadata will be recreated automatically. The operation will be smooth without any additional human intervention. This is the kind of elegant solution I am expecting.
This issue has accumulated enough votes in community ideas (such as this one) and bug reports so that it must be time to fix it. [Update: a new bug report is filed under case #01205225 ]
View comments