I can help a little bit with the first question. That number is a Session ID and is typically created by the VizQL process when the data is loaded for a view. In some instances, these sessions are shared among users to minimize load time. I don't know of a way of retrieving that session ID.
However, after thinking about it, is there a reason why Tabcmd cannot be used? The command "tabcmd export "TheWorkbook/MyView" --csv -f "WeeklyReport.csv" should successfully export the .csv data from the indicated workbook. This article outlines the process in more detail: Exporting a CSV of Underlying Data Using Tabcmd Export or Get | Tableau Software
However, there is this important note from the linked article:
The above commands, tabcmd get and tabcmd export --csv, are both equivalent to choosing "Export > Data" when reviewing the published workbook in browser. This means that the underlying summary data is exported rather than the crosstab itself, therefore crosstab formatting may be lost (such as column order, orientation of rows and columns, etc.).
Hope this helps!
Thank you Nathan,
Unfortunately, the "This means that the underlying summary data is exported rather than the crosstab itself, therefore crosstab formatting may be lost " bit is exactly the problem. We can manually export the report as a crosstab but Tableau doesnt seem to have any option for automating the export as a crosstab. Searching online it seems this has been an issue for a number of users going back several years.
We need to be able to export the actual crosstab view that can be downloaded manually. The only other option I can think of would be to write a script that opens a browser instance, logs in, opens the view address, and clicks the download button. That seems incredibly hacky and potentially unreliable but sadly, I just dont see any other way.
Do you have any idea if Tableau has plans to support crosstab exports in the future? It seems kinda crazy that the feature has been there for years to do manually but we cant call it in out automated processes.
I had a feeling that was going to be an issue. I am not privy to the timeline of upcoming features of new releases other then what is in the current beta versions. However, the best way to get some movement is to add your your feelings, use-case, challenges, workarounds, etc. to the Community Idea Post regarding exporting Crosstabs programmatically: https://community.tableau.com/ideas/1987 Our development team uses the ideas forum to see what is important to our customers.
does anyone know how to generate or where I can find following values from link mentioned by Wesley?
I mean exactly following values:
Can I read them only from PostrgreSQL database? Please advice.
Thanks in advance
I'm not a good resource for this question and it looks like Wesley is a newer member to the forums and may not get the message. I'd suggest reposting to the forums with under a new thread with what you're trying to accomplish and where you're stuck and someone can help you out.
1 of 1 people found this helpful
Of course we know how these vizql sessions are generated. In short:
- first you open a workbook with /workbook/view URL. That will return you the vizql session ID in the result. (show phase)
- second, you bootstrap the view (bootstraping phase)
- third, you can send any vizql command like generate crosstab (interactive phase)
Here is the source code of an application that takes a workbook (Dashboard) and downloads all view's crosstab data in multi sheet excel.
If you'd like to see how to get a working, bootstrapped session from a logged in workgroup session here is the source:
Easy and straightforward. Actually I had a talk at one of the San Francisco Bay Area Tableau User Group on how this whole stuff works:
You can watch the talk and check the slides here: Building Faster Dashboards by Understanding Tableau Server -Databoss
Now you should have everything, the background concepts and source code that is logging in from command line and gets crosstab data from views.
Thanks for the detailed response to the original question. Using your explanation, I have been able to export a crosstab programatically. However, I am finding myself at an impasse, as I want to also pass a parameter into the crosstab and all the methods I have tried are not working. In a browser, I am able to include the parameter as part of the query string like this:
However, including that parameter into the view phase, bootstrap, or interactive phase does not seem to work.
I am using cURL and trusted authentication (ticket). Any ideas on how (and when) I can include this parameter?
what is the exact issue you have? that repo contains a limited version that works for customized views only, you should try with customized views only
if you really need I can update that repo, this project really evolved a lot
I have been trying to work around this starschema/starschema-tableau-excel-extractor · GitHub to export to export tableau dashboards to excel. I tried using it for custom views, I didn't have any luck getting that to work . I am not able to get https://github.com/starschema/starschema-tableau-excel-extractor/blob/master/lib/vizql-session/index.coffee to work. I am able to authenticate and login but the program errors out after that. Any help would be appreciable.