Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Can Alteryx initiate the call to Tableau server to download csv?

Afammy
7 - Meteor

I have a Tableau 10 server report that generates data I'd like to dump into my db. Today the report runs automatically in tableau and generates fresh data, and then I use this data as the source for an excel spreadsheet I manually populate. I'd like Alteryx to replace the manual data entry piece and eliminate the xlsx if possible. 

 

Can Alteryx initiate the call to Tableau to download the report to csv and drop in a directory? I can pull it in from there. I'm also open to any other creative options. 

 

This one's a head scratcher and I'm guessing our infrastructure may also be an obstacle in accomplish this but if anyone can come up with the solution I know it's this ocmmunity. Looking forward to seeing what you come up with. Thanks ahead of time. 

 

11 REPLIES 11
Aguisande
15 - Aurora
15 - Aurora

Hi @Afammy,

I always do this triggering the tabcmd command within Alteryx.

This should do what you need.

Afammy
7 - Meteor

@guisande intriguing...would you mind elaborating further? I have not used this tool before. Thanks. 

Aguisande
15 - Aurora
15 - Aurora

Tabcmd is a command line utility that comes with Tableau (https://onlinehelp.tableau.com/current/server/en-us/tabcmd.htm)

 

I use the export Command especifically for this task (https://onlinehelp.tableau.com/current/server/en-us/tabcmd_cmd.htm#id7cb8d032-a4ff-43da-9990-15bdfe6...), called by a Run Command Tool within my workflow.

In the case of automating a .csv export, you should provide the Tool with the path to the viz and the filename (like in this example):

 

tabcmd export "Q1Sales/Sales_Report" --csv -f "Weekly-Report.csv"

 

 

I strongly recommend the use of the ?:refresh=yes at the end of the viz url, to force a data refresh  (to avoid the risk of getting cached information)

Hope this helps.

Afammy
7 - Meteor

@aguisande Thx for the solution! 

rahulchauhan
7 - Meteor

Can you elaborate on this a bit? 

 

I'm unable to figure out how to use the tabcmd commands in the Run tool. I tried writing the command in the Command Arguments field but the limitation is that it won't accept the 2nd line of command which is for the export - 

tabcmd export "OutboundLinehaulCostAnalysis/CostTableau" --csv --filename "C:\Test1.csv"

 

I've done this without Alteryx, directly from tabcmd and the csv export worked successfully with these following set of commands -

 

cd "C:\Program Files\Tableau\Tableau Server\2019.2\extras\Command Line Utility"

tabcmd login -s https://alchemy.aka.abcd.com -u username -p password

tabcmd export "OutboundLinehaulCostAnalysis/CostTableau" --csv --filename "C:\Test1.csv"

 

The first line (cd part) is covered by working directory field in the Run tool. Second line runs in the Command Arguments field. Unable to figure out where to write the third line and also unable to figure out the use of Write Source and Read Results fields.

tabcmd.png

Aguisande
15 - Aurora
15 - Aurora

Hi @rahulchauhan 

First, make sure that tabcmd.exe is in your PATH environment variable (this will make your tabcmd.exe available to any location on your OS)

 

Can you upload a copy of the workflow? that'll make easy to see how the Run Command tool is configured.

Remember that the Output option of the Tool saves a file, then executes the command, and the reads from the input to get the results.

 

BTW, you can create a .bat file to execute the exact same set of commands you run in the command Line, just save it in the Output option of the Run Command Tool, and execute that .bat file.

 

Then, read the resulting csv file (C:\Test1.csv) and you should be good to go.

 

Finally, if you decide not to use a .bat file, you may need two run command tools, one to handle the login and one for the export.

clipboard_image_0.png

rahulchauhan
7 - Meteor

Thanks for a quick response.

 

I still have the same problem though.

 

The input tool that you've attached to the first run tool, what is that referring to? For my case, there is no other input file (See highlight in my screenshot). My input data itself is what I'm trying to get from Tableau Server which is a csv file.

 

Ideally below would be my complete workflow. Get the data from Tableau Server and then do some transformations and finally spitting out a csv file.

 

 

tabcmd 2.png

 

I tried connecting two Run tools but second one keeps giving me this error. I'm not sure what I'm doing wrong here.

 

PS - Those Test.txt and Test1.csv files are empty files I created because I thought maybe that is what is needed

 

clipboard_image_0.png

Aguisande
15 - Aurora
15 - Aurora

@rahulchauhan 

If you look at the Annotation on the tool, that s the tabcmd login command. Once you execute it, the second run command executes the tabcmd export command.

 

The error on the Run Command is because it has the tabcmd in front of it, just remove it, and it should work.

 

NOTE: The Test.csv file referred on the Input config of the Run Command tool, should be the file generated by the tabcmd command

 

Hope this helps

Aguisande
15 - Aurora
15 - Aurora

Hi @vijayguru 

Can you post a copy of your workflow? I'm pretty sure there's something on the call to tabcmd.exe

Is it on your path?

 

Labels