3 Replies Latest reply on Dec 5, 2019 12:32 PM by Nick Roush

    Export a csv via a URL from Tableau server with Filters applied

    Andrew Watson

      My dashboard is a simple table published to Tableau Server. My requirement is to be able to export that table into Excel.


      Within the table there is actually a number of hidden fields to control sorting, colouring of measures, etc, which I don't want the users to export as this causes some confusion - meaning the Download - Data / Crosstab options are ruled out.


      Therefore I created a hidden worksheet containing only the fields I want exported and created a button that self-calls the dashboard via a URL but with .csv appended to export the data from the hidden worksheet.


      For example the URL of the dashboard is https://TableauServer/.../views/MyWorbookName/MyViewName


      The URL I call from the button to export the hidden worksheet is https://TableauServer/.../views/MyWorbookName/MyViewName.csv


      So far so good however I have stumbled across an issue I don't have an immediate solution for.


      There are filters on my dashboard that apply to both the visible table and the hidden worksheet. However when the export URL is called (i.e. the button is clicked) the spreadsheet doesn't reflect those filters and I'm unsure how I can get it to reflect those filters.


      Anyone with some good ideas on this? I tried appending ":linktarget=_self" to the end of the URL but that didn't work. I'm using MS Edge as my browser as potentially different browsers handle this differently.