Free Trial

Alteryx Designer Desktop Discussions

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

Use Run Cmd to open Tableau Desktop and save hyper file as TDS

stapuff
9 - Comet

On the output of Publish to Tableau Server I get 4 lines returned in the Results pane. Step 0 - Step 3

In the column "filename" under Step 2 & Step 3 a file path is returned. Example - C:\Users\[username]\AppData\Local\Temp\Engine_6444_c40df7a65a2a45febd6acb96bf1ca00d_\TDS_Test.hyper

 

I have a Run Cmd tool set up like the following:

Output - C:\Users\[username\OneDrive - [company name]\Desktop\TDS_Test.tds 

Program Command - C:\Program Files\Tableau\Tableau 2021.3\bin\tableau.exe

Command Arguement - C:/Users/[username]/AppData/Local/Temp/Engine_6444_c40df7a65a2a45febd6acb96bf1ca00d_/TDS_Test.hyper

Input - C:\Users\[username]\OneDrive - [company name]\Desktop\

 

This errors out, but still opens up Tableau Desktop and uses the path as the data source. Alteryx shows the workflow continues to run while I manually go in and create the TDS in Tableau Desktop. Upon creating the TDS as a new data source and closing Tableau Desktop the Alteryx workflow then stops.

 

I am not opposed to this because the net/net is a tds is created, but looking for an option to automatically save the hyper file as a tds (unmodified.... a simple save as tds) using the hyper path provided so I could modify the tds further down in the workflow.

 

The original concept of opening Tableau came from How To Execute Tableau From Alteryx with a follow up blog post on using events by @BenMoss Using Events in Alteryx to open a Tableau Workbook On Workflow Completion 

 

So my ask is

Is there a method using Run Cmd, Events, or any other option to save a hyper file as a tds?

If the popup of Tableau and manual creation is still required how can I set up the current Run Cmd to not error out causing the workflow to stop? I am looking for the workflow to continue onto the next process within the workflow after the tds is created.

 

Your thoughts.

 

Puff

 

12 REPLIES 12
apathetichell
19 - Altair

Is this an Alteryx thing or a Tableau thing? I'm not a Tableau expert but it sounds like you want to convert a file in Tableau? Alteryx isn't Blue Prism or UIPath. It's not going to close your Tableau for you and provide interaction inside of Tableau. It will launch Tableau and can launch Tableau from command line with a run command. What happens in Tableau is going to be in Tableau. There could be an API workaround? If you are having an issue launching Tableau with a specific path included - I'd recommend not using a temp location - at least for starters. Also try swapping from "c:/" to "c:\" in the run command argument.

 

Perhaps what you want is a chained app - or something? That way you can have your input after you've manually converted the file to .tds in the second app via a file browse or the like.

stapuff
9 - Comet

@apathetichell  I appreciate your response back.

 

I pop open Tableau and use the temp file to create the tds currently because that is the only reliable way to create one. All other options I have searched and tried have failed. Spent several months working with Alteryx Engineering to get a fix to the current Publish to Tableau Server with a tds. With no solve from Alteryx I finally "fixed" it and submitted a 17 step procedure to Alteryx on how to "fix" the tool.

 

Now to answer your is this a Tableau or Alteryx thing.... don't know. I am not an expert in either. I am not required to pop open excel to create an excel file or notepad to create a text file so I am looking to see if anyone in the Alteryx world has figured out a way to do so. As I stated in the original post if I need manual intervention and have a 2 step workflow so be it... if I could get this to work within 1 workflow would be preferred.

 

Puff  

cmcclellan
13 - Pulsar

I'd be interested to see your 17 step procedure because I want to understand what you're really trying to do.

 

The Publish to Tableau macro has been around for a long time and works perfectly (for my requirements over quite a few different client engagements).

 

Also, you can't really convert a hyper file (which is really a database) into a TDS file (which is really an XML file that points to the database).

 

I can't figure out why you really want to do this though .... why does the macro NOT do that you're trying to do ?  The macro creates the data source on Server/Online and anyone can now use it.

stapuff
9 - Comet

@cmcclellan 

The 17 step procedure was a fix to Publishing to Tableau Server with a tds.  I have heard of many speak of the capability, yet  could not get 1 to publish with a tds.  Without a tds.... I can publish all day long.

 

So what is Puff trying to do:

 

I create data sources. When those data sources are ready to publish to Tableau I break out the handy dandy Publish to Tableau Server tool and publish the data source to Tableau (without a TDS)  because when I would try to manually create the TDS filling in things like Comments with system data dictionary information, create folders, calculated fields, etc, etc, etc.... it would fail.  

 

I found that the temp file created after the first Publish creates a perfect tds which is locate in the filename column of the output. I follow the step below and reference the tds in the Publish to Tableau Server tool and never have a failure.

 

Notice I mentioned after the first publish. What I am trying to accomplish is have the workflow continue to run capture the temp url, create the base structure of the tds then backfill it with data dictionary information, create folders, etc programically.

 

What I currently have is after the publish to Tableau I capture the temp file and pop open Tableau via Run Cmd and create the base structure of the tds manually. Once the tds is created and saved the workflow stops because of the error as mentioned in the original post. I then need to kick off a second workflow that absorbs the newly created tds and backfills it with data dictionary information, create folders, etc 

 

Wouldn't it be Lucky Charms (magically delicious) if I could click run and it did it all by itself.

 

A couple things to note:

In discussions with Alteryx engineering... the issue I have with publishing with a .tds is a "Known Issue" and a reason why they are working on a new tool.

When I informed them I had a fix I was asked to provide them the steps I took to solve it, which is written below.

 

Clear as mud?

 

Puff

 

Step 1
Create a workflow with Input Tool and Publish to Tableau Server tool.

Step 2
Publish the data source without referencing a .tds

Step 3
Click on the output side of the Publish to Tableau Server tool... you will see 4 records in the Results pane.

Step 4
In the Results Pane look for the column name "filename". Bottom 2 records should have a file path like the following:
"filename"
C:\Users\[user]\AppData\Local\Temp\Engine_12228_8350a6a55a3743b09b8043b33f3853b3_\PM_Plant_Details.hyper
Copy that file path

Step 5
Open up Tableau Desktop and select "More ..." listed under To a File section.

Step 6
Paste the path under from Step 4 in the "File name" popup dialog box. Then click "Open". A Tableau worksheet should appear.

Step 7
Create folders, add comments, calculated fields, whatever at this time.

Step 8
Right click the data source name in the Data pane (upper left corner of the worksheet) and select "Add to Saved Data Sources"

Step 9
A dialog box with the name and .tds extension will appear. Mine has "(local copy)" in part of the filename, which I remove.
Click Save

Step 10
Close Tableau Desktop

Step 11
Tableau will ask "Do you want to save the changes to the workbook"... I click "No".

Step 12
Locate the .tds file saved in Step 9. Open up the .tds with text editor like Notepad++. You will see the raw xml of the .tds

Step 13
In the xml look for the following:
dbname='[my path]/PM_Plant_Details1.tds Files/Data/Extracts/PM_Plant_Details.hyper'
Remove everything from dbname in front of the word "Data". Should look like the following:
dbname='Data/Extracts/PM_Plant_Details.hyper'

Step 14
Save the the newly modified xml .tds file.

Step 15
Go back to the workflow in Step 1. Click on the Publish to Tableau Server tool. Select the "folder" icon in the Data source metainfo (optional) section and locate the path to the newly created .tds file.

Step 16
Run the workflow. Should see no publishing errors in the Results pane.

Step 17
Check Tableau to make sure the .tds was published and functioning correctly.

 

cmcclellan
13 - Pulsar

OK, that makes sense, but you can't automate Step 7 that's a custom job for every different data source.

 

You could automate everything up to and including Step 6, you could possibly automate everything after Step 7, but I'm not sure about Step 15

stapuff
9 - Comet

@cmcclellan 

Automating Step 7 would be easy, but a base (skeleton) .tds needs to be created first, which I lack at the end of my 1st workflow since I need to create it manually and the workflow stops based on the error.

 

Almost as if I could do a save .hyper as .tds so at a minimum the field list would be in the .tds (not sure if that makes sense or not)

 

The inspiration for what I am try to do comes from Automated Metadata Documentation 

If you notice the very first input is an already created .tds

 

The second workflow I kick off is something similar to the link.  Not to the extreme since I do not need to build in all the checks.

 

Puff

cmcclellan
13 - Pulsar

I know you might be simply using the wrong words, but you can't save a hyper file as a TDS they are 2 completely separate file types.

 

How do you automate Step 7 ? Surely the folders, calculations and comments that you want to include will change for every data source that you process, right ?

stapuff
9 - Comet

@cmcclellan "Almost as if" is not literal. I realize they are 2 different file types.

 

Step 7 is nothing more than creating and adding xml to the .tds Just need to know the xml and location it needs to be placed in.

 

Puff

 

 

cmcclellan
13 - Pulsar

Sorry, I don't understand how "Create folders, add comments, calculated fields, whatever at this time." can be fully automated and is inserting some XML into an existing file (or a file you create).

 

Maybe my understanding is wrong, but I don't think it mattered where the TDS file was located, it's more just pointing to the actual source.  Couldn't you create that from Alteryx ?

 

Or if you can automate Step 7, then have a template for what your TDS file should be ?

Labels
Top Solution Authors