2 Replies Latest reply on Jul 30, 2018 1:35 PM by Jeff Strauss

    Tabcmd Tableau Export as png with multiple filters

    Dhruv Malik

      Hello,

      I'm relatively new to tabcmd and command prompt in windows ( that's what I'm using to create my batch file). So, I am trying to export a dashboard as png with 4 filters. I was able to successfully do the export via a batch file by using tabcmd. The filters are coming in from a delimited file that the user is filling as and when they need to change the filters. My problem is when the user selects "All" for any filters other than the last filter, which I know is empty string for tableau, the batch file is not recognizing the empty string and is displacing all the following filters one up by completely ignoring the empty string filter.

       

      Eg:

      I have 4 filters and the third filter needs to be "All". This is how my file is currently:

      Filter1/Filter2//Filter4

      Then the batch file uses the FOR loop and goes through the delimited file to run the report for all these filters. The problem arises when the filter3 is an empty string. My batch file is considering Filter4 as filter 3 and that messes up the entire dashboard result.

       

      Here is the command I'm using in  the batch file:

      FOR /F " tokens=1,2,3,4 delims=/" %%A IN ('type "FilterListFile.txt"') DO tabcmd get "/views/Dashboard.png?Filter1=%%A&Filter2=%%B&Filter3=%%C&Filter4=%%D" -f "\\DesiredSaveLocation-%%A.png"

       

      I think maybe I can be using an if statement or something else, but don't know how!  Any help would be appreciated.