[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 ]
Can you please expand on what to do in "2.Copy over composite metadata to the new data source." in The Workaround section? What is composite metadata?
ReplyDeleteCopy over means: copy a metadata item from the original data source and paste it to the new data source.
DeleteComposite/derived metadata: a dimension/measure that is derived from original dimensions/measures, such as calculated fields, sets, groups, parameters, etc.
Just found this article dealing with the same pain.
ReplyDeletehttp://www.theinformationlab.co.uk/2014/06/09/using-tableaus-replace-data-source-function/
A general approach to solve the problems of migrating data sources:
ReplyDelete1.Start a new tableau. Open the data sources like tdes. Publish them one by one.
2.In the workbook, open the new data sources from the server
3.Copy and paste calc fileds, groups, aliases from the existing data sources to the new ones etc.
4.Replace the existing data sources by the new ones.
5.Fix any filters, legends if broken in the charts etc.
To minimize the pain in copying, do these:
ReplyDelete1.Hold ctrl key to multi-select all calc fields, groups, sets etc (right click and select Copy)
2.Right click dimensions in new data source and paste all of them in one shot.
Another thing is that quick filters may be broken.
ReplyDeleteAfter replacing the data source, even after copying over the calc fields, the quick filters may become blank (we only see the frame.)
To fix this, do these:
1.Click x on the frame to close it.
2.Ctrl-Z to undo the above. The filter will miraculously appear in multi-option form.
3.Set the filter to single value type or what ever type you wish.
Proposed an idea to Tableau for fixing this issue
ReplyDeletehttp://community.tableau.com/ideas/4859
How do you copy over aliases?
ReplyDeleteI don't know how. Creating a calc field as an alias column will make it more portable when replacing data source.
DeleteA related note on the topic
ReplyDeletehttp://vizdiff.blogspot.com/2015/07/replacing-data-source-fast-way.html
This comment has been removed by the author.
ReplyDeleteWhat is your question exactly?
DeleteHere is my best practice of dealing with replacing data source problem.
http://vizdiff.blogspot.com/2015/07/replacing-data-source-fast-way.html
I just encountered the same problem. Below is my check list in order to recover my published dashboard.
ReplyDelete1. table rank;
2. Color or Size (if you manually changed them);
3. Format of quick filters and/or legends (such as "Single Value (List)" to "Single Value (Dropdown)");
4. Dimension Alias;
5. Sequence and Alias of columns (if you manually changed them);
6. Hierarchy of dimensions
Above all, check through your dashboard to see if there is any other issues because I found a filter missing in just one worksheet. I am not sure if I deleted by accident or it resulted from data source replacement.