Was this page helpful?
Yes No

Teradata

This topic describes how to connect Tableau to a Teradata database or a Teradata Unity server and set up the data source.

In this article

Before you begin

Before you begin, gather this connection information:

  • For Teradata database: Name of the server you want to connect to

  • For Teradata Unity server: URL of the server you want to connect to

  • Authentication method: Teradata Database, LDAP, or Integrated Authentication

  • Depending on the environment, the user name and password

  • Do you need an encrypted connection?

  • (Optional) Query banding and initial SQL statement to run every time Tableau connects

Driver required

This connector requires a driver to talk to the database. You might already have the required driver installed on your computer. If the driver is not installed on your computer, Tableau displays a message in the connection dialog box with a link to the Driver Download page where you can find driver links and installation instructions.

Make the connection and set up the data source

  1. Start Tableau and under Connect, select Teradata. For a complete list of data connections, select More under To a Server. Then do the following:

    1. Enter the name of the server that hosts the database you want to connect to.

      Note: You can connect to a Teradata Unity server by entering the appropriate URL in the Server text box.

    2. Select how you want to sign in to the server. Specify whether to use the built-in Teradata Database authentication, LDAP, or Integrated Authentication.

      If the server is password protected, and you are not in a Kerberos environment, you must select Teradata Database or LDAP and enter the user name and password.

    3. Select the Require Encryption check box if you need an encrypted connection.

    4. (Optional) Select Query Banding and Initial SQL.

    5. Select Sign In.

      If Tableau can't make the connection, verify that your credentials are correct. If you still can't connect, your computer is having trouble locating the server. Contact your network administrator or database administrator.

  2. On the data source page, do the following:

    1. (Optional) Select the default data source name at the top of the page, and then enter a unique data source name for use in Tableau. For example, use a data source naming convention that helps other users of the data source figure out which data source to connect to.

    2. From the Database drop-down list, select the search icon or enter the schema name in the text box and select the search icon, and then select the database.

    3. In the Table text box, select the search icon or enter the table name and select the search icon, and then select the table.

      You can also specify a stored procedure in the database. For more information and for a list of constraints specific to Teradata databases, see Use a Stored Procedure.

    4. Drag the table or stored procedure to the canvas, and then select the sheet tab to start your analysis.

      Use custom SQL to connect to a specific query rather than the entire data source. For more information, see Connect to a Custom SQL Query.

Teradata data source example

Here is an example of a Teradata data source using Tableau Desktop on a Windows computer.

Sign in on a Mac

If you use Tableau Desktop on a Mac, when you enter the server name to connect, use a fully qualified domain name, such as mydb.test.ourdomain.lan, instead of a relative domain name, such as mydb or mydb.test.

Alternatively, you can add the domain to the list of Search Domains for the Mac computer so that when you connect, you need to provide only the server name. To update the list of Search Domains, go to System Preferences > Network > Advanced, and then open the DNS tab.

Use query bands to increase performance

When you connect to a Teradata database, you can optionally define query band statements that run during connection. These statements can increase performance, and they take advantage of the built-in security rules of the database.

Using query bands, you can pass parameters into the Teradata environment. Use these to set up a workbook to filter the data based on security rules that exist in the database. For example, you can pass in the Tableau Server user name for the current user so that when the view is loaded it only shows the data specific to that user. Query bands can also be used to improve performance. When connecting to Teradata, you can define a map between the name of the attributes passed into the query band and the corresponding values from Tableau.

To set up query banding:

  1. On the data source page, select Data > Query Banding and Initial SQL.

  2. In the subsequent dialog box, specify name/value pairs in the top text box labeled Query Banding. You can use the Insert drop-down menu to add Tableau values. The Tableau values are described in the table below.
    ValueDescriptionExample
    <TableauMode>The mode Tableau is operating in when generating queries. This value will either be “Connect” when retrieving metadata or “Analytical” when retrieving actual data.Connect or Analytical
    <LoginUser>The user name of the person signed in to the database.jsmith
    <ServerUser>

    The signed-in Server user. Does not include domain name.

    Note: ProxyUser returns the same value as ServerUser. However, ProxyUser sets up impersonation and stores the Tableau Server user in the query band parameter. If you are using query banding for security purposes, you should use ProxyUser instead. This will ensure that query results are not shared between different users. ServerUser should only be used for auditing purposes.

    jsmith
    <ServerUserFull>

    The signed-in server user including the domain name (if the server is using Active Directory).

    Note: ProxyUserFull returns the same value as ServerUserFull. However, ProxyUserFull sets up impersonation and stores the Tableau Server user in the query band parameter. If you are using query banding for security purposes, you should use ProxyUserFull instead. This will ensure that query results are not shared between different users. ServerUserFull should only be used for auditing purposes.

    domain.lan\jsmith
    <ProxyUser>

    Used when setting up impersonation on the server. Provides the username of the current server user.

    jsmith
    <ProxyUserFull>

    Used when setting up impersonation on the server. Provides the username and domain name of the current server user.

    domain.lan\jsmith
    <TableauApp>The name of the Tableau application.Tableau Desktop Professional or Tableau Server
    <TableauVersion>The version of the Tableau application6100.11.0428.0300
    <WorkbookName>The name of the workbook.Financial-Analysis

An example query band statement is shown below. This example passes the user name for the current server user.

ApplicationName=<TableauApp>Version=<TableauVersion>ProxyUser=<ProxyUser>TableauMode=<TableauMode>

Tableau checks the statement for errors as you type. When it is valid a green check mark displays at the bottom of the text box.

Use initial SQL commands

When you connect to a Teradata database, you can optionally specify a SQL command that will be run once upon connection. See Run Initial SQL to learn more about adding these commands to your connection.

Note: If Tableau detects that the Initial SQL payload cannot be delivered in one query, it attempts to split the query into separate statements, where each statement must end with a semicolon followed by a newline character, with no additional characters (such as an extra space) in between. This requirement is important because if a semicolon exists within the interior of a statement, for example within a string literal, it may not be safe to split the statement at that point. If the Initial SQL code that you specify in Tableau returns an error, and the same Initial SQL is deemed valid by the Teradata databases, it may be that Tableau has split the query incorrectly. If this happens, try reformatting the SQL code in Tableau manually.

 

See also

Set Up Data Sources – Add more data to this data source or prepare your data before you analyze it.

Build Charts and Analyze Data – Begin your data analysis.

Tableau and Teradata: The visual approach to the active warehouse - Read the Tableau whitepaper (registration or sign in required).