All Products
Search
Document Center

Hologres:Tableau

Last Updated:Aug 13, 2024

This topic describes how to use Tableau to connect to a Hologres instance and analyze data in a visualized manner.

Background information

Tableau is a secure and flexible end-to-end data analysis platform. Tableau provides a complete set of features from connection setup to collaboration. Hologres is compatible with PostgreSQL. You can connect Tableau to a Hologres instance for data analysis in a visualized manner.

Use Tableau Desktop to connect to Hologres

  1. Download and install Tableau.

    Download a Tableau client from the Tableau official website based on your business requirements and install the client. In this example, download and install Tableau Desktop.

  2. Configure a Tableau Datasource Customization (TDC) file.

    For better performance and experience, configure a TDC file to customize and optimize the connection to the Hologres data source. To configure a TDC file, perform the following steps:

    1. Download the TDC file.

    2. Copy the TDC file to the related directories of Tableau Desktop and Tableau Server.

      • For Tableau Desktop, copy the TDC file to the Datasources directory of Tableau Desktop. The default directory is Documents\My Tableau Repository\Datasources.

      • For Tableau Server, copy the TDC file to the following directory on each node of Tableau Server:

        • Windows: ProgramData\Tableau\Tableau Server\data\tabsvc\vizqlserver\Datasources.

        • Linux: /var/opt/tableau/tableau_server/data/tabsvc/vizqlserver/Datasources/.

    3. Restart Tableau Desktop and Tableau Server.

    For more information about the TDC file, see Tableau Help.

  3. Connect to a Hologres instance.

    1. Start Tableau Desktop.

    2. In the left-side navigation pane, choose Connect > To a Server > PostgreSQL. In the PostgreSQL dialog box, configure the parameters for connecting to a Hologres instance.

      The following table describes the parameters.

      Parameter

      Description

      Server

      The public endpoint of the Hologres instance.

      You can obtain the endpoint of the Hologres instance in the Network Information section of the Instance Details page in the Hologres console.

      Port Number

      The port number of the Hologres instance.

      You can obtain the port number of the Hologres instance in the Network Information section of the Instance Details page in the Hologres console.

      Database

      The name of the Hologres database.

      Authentication

      The authentication method. Select User Name and Password.

      Username

      The AccessKey ID of the Alibaba Cloud account.

      You can obtain the AccessKey ID from the AccessKey Pair page.

      Password

      The AccessKey secret of the Alibaba Cloud account.

      You can obtain the AccessKey secret from the AccessKey Pair page.

      Require SSL

      Specifies whether an SSL certificate is required to connect to the Hologres instance. Do not select this check box.

    3. (Recommended) Click Initial SQL and configure the application_name parameter. Sample command:

      SET application_name='tableau'

      After you configure the application_name parameter, you can quickly identify SQL statements that are initiated by Tableau in query logs and running SQL statements.

    4. Click Sign In.

  4. Analyze data in a visualized manner by using Tableau Desktop.

    After you use Tableau Desktop to connect to your Hologres instance, you can analyze data of existing tables in the instance in a visualized manner. For more information, see Get started with Tableau.

Publish workbooks of Tableau Desktop to Tableau Server

To publish a workbook of Tableau Desktop to Tableau Server for analytics and management, perform the following steps:

  1. Download and install Tableau Server.

    Download a Tableau Server client from the Tableau official website based on your business requirements and install the client.

  2. Use Tableau Desktop to connect to Tableau Server.

    1. Start Tableau Desktop and choose Server > Sign In in the top navigation bar.

    2. In the dialog box that appears, enter the URL of Tableau Server and click Connect.Sign In

    3. On the logon page, enter the username and password used to connect to Tableau Server and click Sign In.

  3. Publish a workbook to Tableau Server.

    1. Log on to Tableau Server and choose Server > Publish Workbook in the top navigation bar.

    2. In the Publish Workbook to Tableau Server dialog box, configure the parameters that are described in the following table.

      发布工作薄

      Parameter

      Description

      Project

      The name of the project for which you want to publish a workbook.

      Name

      The name of the workbook that you want to publish.

      Tags

      Tags that help you find the related workbooks when you browse the server. Separate tags with commas (,) or spaces.

      Permissions

      Use the default settings.

      Data Sources

      Tableau Server provides the following two authentication methods for data sources:

      • Prompt user

      • Embedded password

      If you select Embedded password from the drop-down list, Tableau embeds the information about the connection between the workbook and the data source into the workbook and allows all users who are granted the required permissions to view the workbook. When you use Tableau to connect to a Hologres instance, the AccessKey ID and AccessKey secret are required. We recommend that you use the Embedded password method.

    3. After you configure the parameters, click Publish. Then, you can view the published workbook in Tableau Server.

FAQ

  • Problem description: An exception occurs in the time zone of TIMESTAMPTZ data in the query result.

    • Cause: By default, the time zone of TIMESTAMPTZ data is PRC in Hologres and UTC in Tableau. Therefore, TIMESTAMPTZ data may be displayed as different time values due to the inconsistency in time zone.

    • Solution: Configure initial SQL statements in Tableau.

      Note

      This solution takes effect only on data sources that you specified when you use Tableau to connect to Hologres.

      Initial SQL statements can be configured in the following scenarios:

      • You use Tableau to connect to Hologres for the first time.

        In this case, perform the following steps:

        Enter the following SQL statement in the Initial SQL field:

        SET TIME ZONE "PRC";

        初始化SQL

      • You have already used Tableau to connect to Hologres. In this case, perform the following steps:

        1. Click Initial SQL.初始化SQL

        2. In the Initial SQL dialog box, enter the following SQL statement:

          SET TIME ZONE "PRC";
        3. Click OK.

        4. Click the 刷新 icon in the upper-left corner to make the settings take effect.

  • Configure time dimensions.

    We recommend that you do not perform format conversion more than once in Tableau when you use time dimensions. In this example, you want to set the format of the l_shipdate column to the Date/Time format. In this case, you need to set the column to the TIMESTAMP or TIMESTAMPTZ format when you create the related table in Hologres. This helps you prevent unnecessary format conversions.时间类型维度设置