Convert XML Metadata of Tableau Workbooks (TWB) to Text
In this walkthrough, we will demonstrate the processing of tableau workbooks using Flexter. We will then load the output into Tableau to get an under the hood view of the metadata contained inside Tableau Workbooks. This is useful e.g. to identify which tables, metrics, and columns are used in a particular worksheet or dashboard.
About Tableau
Tableau is a data visualization tool that enables users to connect to various data stores and create views/graphs of data based on requirements. Users can create interactive dashboards with Tableau and analyse data.
Tableau Workbooks
A .twbx file is a Tableau Packaged Workbook, meaning it is the original .twb file bundled together with the data source in one package. .twbx files can be considered analogous to specialized zip files, in which these “zip” files contain all the information necessary to work in Tableau. The .twb file alone is not enough to perform any analysis because it only contains Tableau’s instructions for interacting with a data source. In actuality, .twb files are XML files specially tailored to interact with data sources. In this walk through, we will process this XML file using Flexter and then load the TSV output into tableau for querying/analysis.
Tableau workbooks contain all of the metadata of Tableau reports and dashboards, e.g. the name of fields and columns used in a report, the number of worksheets, formulas etc. etc.
Processing the Tableau workbook file
We will be using Flexter to convert the Tableau workbook XML data to TSV. Flexter is a tool that can transform complex XMLs into readable files that can be used for analysis. The step by step instructions for transforming XML files using Flexter are shown below.
- Access Flexter from https://xmlconverter.sonra.io/
- Click on the ‘Terms and Conditions’ checkbox and click ‘Try Flexter for Free’
- The .twb files have to be converted to .xml files and then zipped as shown below.
- Upload the zipped XML file folder and click ‘Continue’
- In the next page, we can upload the XSD file (if available). For this implementation, the XSD file is not available and hence we will click on ‘Skip ‘and proceed to the next page.
- Provide Email and click ‘Continue’
- The conclusion page is displayed and the output will be delivered to the subscribed email address.
- An email from Flexter with the link to the transformed data is obtained. The TSV files can be downloaded from this link which redirects to the Flexter page.
- For the Tableau workbook XML, a total of 20 TSV files were generated and downloaded.
The ER diagram of the data analysed by Flexter is shown below
Loading the Flexter output to Tableau
The following steps describe the process of loading the TSV files into Tableau and analysing the data.
Step 1. Login to Tableau Desktop
Step 2. Click on Connect to a file -> Text File and select the workbook.tsv file as input
Step 3. The worksheet is created as shown below
Step 4. Add a connection for the file worksheet.tsv
Step 5. Specify the join type as ‘Inner Join’ and the join clause as ‘PK_Workbook’ and ‘FK_Workbook’
Step 6. In a similar manner, add the files metadata-record.tsv, relation_columns_column.tsv
Step 7. The column names of a particular table and the related workbook can be seen from the Tableau output
Step 8. The worksheets and the corresponding workbooks can be visualised as shown below
Step 9. The column names for each workbook and their related worksheets can be seen from below.
The Flexter output displays an in-depth infographic of how Tableau processes the data attributes for visualisation and analysis and helps in isolating individual entities for deeper insights.