Exporting CSV Made Simple

Andy Kriebel
on April 24, 2014

Editor's note: Tableau Zen Master Andy Kriebel is data visualization guru at Facebook and data blogger at VizWiz. Andy published the following Tableau tip on his blog on March 13, and we are republishing here with his permission as part of the #TableauTipsMonth series.

We’ve all heard this question before: How can I export a CSV in Tableau? To be honest, it’s quite the pain and way more difficult than it should be. There have always been a few options.

  1. Users can click on a specific sheet on a dashboard and then export that via the tiny button on the toolbar, but that has a few of its own problems: (1) You may not want to show the toolbar therefore making the export impossible, (2) People have to be trained to know exactly where to click to get it just right, and (3) You have no control over the output of the CSV.
  2. You can export a CSV using Tabcmd, but that’s not useful for the average dashboard consumer.
  3. You can add .csv to the end of the URL like http://[Tableau Server Location]/views/[Workbook Name]/[View Name].csv. But again, you never know what that output is going to look like.

Yesterday I learned an incredibly valuable trick that would make option 3 (adding .csv to the URL) export exactly the CSV you want. Let’s look at an example.

On this dashboard, notice how I added an Image object (I used an Excel icon) on the dashboard. I’ve floated it to the upper right and made it small. All the user has to do is click on that icon and they get a nice CSV. Go ahead, try it!

Did you try it? If you did, and you opened the CSV, you may have noticed this looks remarkably like the data that you would hope to get if you exported the data for the line chart. But I didn’t export the line chart at all. Here’s the trick.

  1. Add the image icon on the dashboard and place it wherever you like.
  2. Add a URL link to the image. In the dashboard above, the URL is http://public.tableausoftware.com/views/ExporttoCSV/Dashboard.csv.

    This is where the magic sauce happens. When you add .csv to the end of a Tableau URL, Tableau will export the first sheet on the dashboard alphabetically. Yes, it’s that simple! And it’s totally undocumented. Special thanks to the one and only Tableau Jedi Mark Rueter for this tip! But note that Tableau orders upper case before lower case.

  3. What I did was float a sheet named AExport onto the dashboard. I changed the height to 1 and made everything white and transparent and chose Fit Entire View so that it would be inconspicuous. I had to name it with a capital A so that it would be the first sheet alphabetically on the dashboard.

Image 1

The AExport worksheet started off like this:

Image 2

Basically, you can put anything you want on this sheet. I then changed the transparency to 0% on the Color shelf, changed the default worksheet color to white, removed the row banding and removed the row and column dividers. The worksheet now looks like this:

Image 3

That’s all there is to it! To recap:

  1. Create a worksheet that you want to export.
  2. Remove all of the formatting to make it look invisible.
  3. Be sure to give it a name that makes it first alphabetically on the dashboard.
  4. Place the worksheet on the dashboard, float it, make it fit the entire view, make it really small, move it somewhere inconspicuous.
  5. Add an image onto the dashboard, float it and add a URL to it that is the URL for the dashboard with .csv on the end.

This is a game changer!! Download the sample workbook here.


Silly question....but is Tableau not about taking raw/structured data source and visualizing it?

So surely you have the CSV source already so why do you need a means to export it ?

Good feature, but there seems to be a few annoyances to this funcionality.

1) The exported file is comma separated and not tab separated. Meaning the file will not automatically open in Excel with the data in Excel columns. You have to use the cumbersome file open dialog in Excel in order to import the file.

2) International letters are not displayed correctly in Excel. This is probably due to some character encoding. But this is not the case when using the normal Tableau export function on Tableau Server.

Anyone knows workarounds for these issues?

How do I refresh the data in the export? I have this working and I have a quick filter in my dashboard. Within the desktop when the quick filter is used the viz changes and I go to the data sheet and I see it changed based on the filter. I publish the workbook and when I interact with the workbook in server and use the quick filter the dashboard changes and when I use the export link the data is from when I published the workbook. How do I get that export to use the refreshed data?