Exporting DATA from Tableau to Excel
Even if your Tableau visualizations are beautiful, informative, and actionable, you will need to export data to a tabular format, usually via Excel.
Although this is still surprisingly more difficult than it should be, a few ‘non-coding’ choices can assist you in meeting this criterion. Let’s look at the “simple” alternatives for enabling others to access the data behind your visualizations and what to expect from the output.
The common choices for getting data are all sheet-by-sheet exports.
The first method is to use Tableau’s built-in export functionality. This can be found by right-clicking on any data point within a visualization. The output will be a .CSV file that can be opened in Excel. You will need to export each view separately.
To export data from Tableau to Excel, follow these steps:
- In Tableau, select the view that you want to export.
- Click the File menu and select Export > Crosstab.
- Choose where you want to save the file and click Save.
- Open the .csv file in Excel and save it as an .xlsx file.
The second method is to use the Web Page (embedded) option to generate an HTML page that can be viewed in a browser. The data can then be downloaded by selecting the download option from the browser’s menu.
The third method, arguably the best, is to use Tableau’s JavaScript API. This will allow you to embed your visualizations into an existing web page and still retain the ability to export the data.
A couple of built-in choices outlined in Tableau’s help documentation allow you to export from Tableau Desktop. Alternatively, you can obtain a subset from the data source or data pane on the view’s page or within the view itself.
The export alternatives are a CSV file, an Extract (.hyper) file, or a Tableau Data Source (.tds) file. These may then be used to connect directly to Tableau or share the data for others to use. The choices are either to export/copy to .CSV or create a crosstab in Excel if you only want the data for one view or sheet.
Output Control Options for Single View Export
The most significant distinction between these two choices is the level of control over the output. The .CSV variant does not maintain the formatting, so the fields used to generate the view will appear in alphabetical order. On the other hand, the Excel crosstab will retain formatting (unless you disable this) and would provide your end-user with a “more attractive” appearance.
However, in our experience, if you have more extensive data, the crosstab’s performance may be damaged or fail. You may exercise somewhat more control by using aliasing to force column order when exporting with the .CSV option or by creating the exact view your customers want to export depending on your use case.
Exporting Data from Tableau Server
In most situations, your users will want a convenient method to save data from the Tableau Server, which is where they spend most of their time. If formatting preservation is a priority, simply clicking the download icon in the top right corner and selecting ‘Crosstab’ is the ideal solution.
The entire process is outlined in this example. This method requires some end-user training, but the output is more attractive, considers any filtering that has occurred before exporting, and can handle a big data set.
If formatting is not required, you may also pick the ‘Data’ option from the Download menu to obtain a static file.
If you don’t want to educate your end-users and don’t have time to acquire a “Degree in CSVs” follow Andy Kriebel’s advice, which entails appending .CSV to the end of your dashboard URL and embedding it inside an image icon on your dashboard. This method works similarly to the other .CSV exports described above. You may also use this URL with parameter/filter values.
Tableau to Excel in Summary
There are a few things to keep in mind when exporting data from Tableau to Excel.
First, Tableau will only export the currently visible data in the view. This means that if you have filtered the data, only the filtered data will be exported.
Second, Tableau does not support exporting to .xlsx files. You will need to export to a .CSV file and then convert it to a .xlsx file.
Finally, Tableau does not natively support exporting to multiple worksheets in one Excel file. The ONLY method to export everything on a dashboard at once to a single Excel workbook is to utilize the ‘Export All Extension’ created by the Information Lab (for Tableau version 2018.2 or later). This add-on allows you to add a beautiful export button on a dashboard that will prompt you to pick the sheets and columns you want to export. If you’re using this for commercial dashboards with important data, be aware of its security concerns.
This article explains how to export data from Tableau to Excel based on our experiences. It describes how to export data that is currently visible in a view and preserve formatting when exporting data. It also explains how to export data from Tableau Server. Finally, it describes how to export data to multiple worksheets in Excel.
And while this list is not exhaustive (it doesn’t account for languages like JavaScript that may be used to generate tabular data), it should provide at least one simple solution to meet your requirements for tabular data!