In this post I will describe how to create or migrate a report to Tableau Online (cloud) and how to automatically refresh the data source in a scenario where Tableau Online does not have direct access to the source database.
- Creating/Migrating Report
- Using Tableau Desktop – open an existing Tableau report or create a new report
- Login to Tableau Online
- Publish used extract to Tableau Online
Provide required project and permissions
- Connect to published data source
Note that because the new data source has the same name as the existing extract, Tableau will automatically show the name with _1 in the name
- If you have existing filters in your report, it is best to cache the filters in order to avoid loosing the filters in the next step.
Open each sheet/dashboard which contains filters and wait for the page to load until the filters are properly cached.
Repeat this step for any sheet with filters. - Replace the current data source with the published version
- Close the unused data source
- Publish your workbook to Tableau Online
- Schedule Data Source Refresh
- In order to automate the refreshing of the data source we will use a windows task with the command: tableau.com.
You can automate the task from any machine that has access to both Tableau Online & the source database.
The command used can be found in the folder of Tableau Desktop:
C:\Program Files\Tableau\Tableau 8.2\bin\tableau.com
- In this example we will use a windows scheduled task to refresh the extracts:
Program/script: "c:\Program Files\Tableau\Tableau 8.2\bin\tableau.com" Add arguments: refreshextract --server https://online.tableau.com --username <user@domain.com> --password <password> --site <site> --project <"Project"> --datasource "CustomSQL_Extract" –source-username <DB_User>--source-password <DB_Password>
- Example of execution in command line
- Please note that for proper secure connectivity to Tableau Online you need to apply the root certificate:
Thawte Primary Root CA – G3 (SHA256)
- In order to automate the refreshing of the data source we will use a windows task with the command: tableau.com.