Tableau Redshift Optimization

Make the connection and set up the data source in Tableau :

  • Start Tableau Desktop and under connect, select Amazon Redshift.

1 tableau connection page

 

  • 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.

2 credentials

 

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.

3 select schema & table

  • Click on the Data tab, from the custom sql query option select Add to Saved Data Sources...

 

3

 

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.

 

4

  • Modify the existing Saved Data Source to add the following query as shown in the screenshot.
      odbc-connect-string-extras='UseDeclareFetch=0'
      <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>

5

  • Use the modified Saved Data Source to create Tableau Reports.

 

3 rep

  • Open SQL Workbench/J and connect to the Amazon Redshift by providing required credentials.

 

amazon connection workbench

 

  • 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';

8

  • Now you can run the select query which you got from the above to check the data retrieved from Amazon Redshift by Tableau.

 

9

Leave A Reply

Your email address will not be published. Required fields are marked *