Make the connection and set up the data source in Tableau :
- Start Tableau Desktop and under connect, select Amazon Redshift.
- Enter the name of the server that hosts the database and the name of the database you want to connect to.
- Enter the username and password.
- Select Sign In.
On the Data Source page :
- From the Schema drop-down list, select a schema or use the text box to search for a schema by name.
- Under table, select the requisite tables and drag them to the canvas.
- Select the Sheet tab to start your analysis.
- Optionally you can use the Custom SQL to connect to a specific query rather than the entire data source.
- Click on the Data tab, from the custom sql query option select Add to Saved Data Sources...
Working with the Saved Data Source :
- Locate the saved data source in your computer which is in the .tds format and open it with notepad to edit it.
- Modify the existing Saved Data Source to add the following query as shown in the screenshot.
<connection-customization class='redshift' enabled='false' version='10.1'> <vendor name='redshift' /> <driver name='redshift' /> <customizations> <customization name='odbc-connect-string-extras' value='UseDeclareFetch=0' /> </customizations> </connection-customization>
- Use the modified Saved Data Source to create Tableau Reports.
- Open SQL Workbench/J and connect to the Amazon Redshift by providing required credentials.
- Run the following command to check the query used by Tableau to interact with Amazon Redshift.
SELECT * FROM STL_QUERY WHERE STL_QUERY.database = 'pbi';
- Now you can run the select query which you got from the above to check the data retrieved from Amazon Redshift by Tableau.