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
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.
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:
Download the TDC file.
Copy the TDC file to the related directories of Tableau Desktop and Tableau Server.
Restart Tableau Desktop and Tableau Server.
For more information about the TDC file, see Tableau Help.
Connect to a Hologres instance.
Start Tableau Desktop.
In the left-side navigation pane, choose > 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.
(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.Click Sign In.
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:
Download and install Tableau Server.
Download a Tableau Server client from the Tableau official website based on your business requirements and install the client.
Use Tableau Desktop to connect to Tableau Server.
Start Tableau Desktop and choose in the top navigation bar.
In the dialog box that appears, enter the URL of Tableau Server and click Connect.
On the logon page, enter the username and password used to connect to Tableau Server and click Sign In.
Publish a workbook to Tableau Server.
Log on to Tableau Server and choose in the top navigation bar.
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.
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.
NoteThis 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";
You have already used Tableau to connect to Hologres. In this case, perform the following steps:
Click Initial SQL.
In the Initial SQL dialog box, enter the following SQL statement:
SET TIME ZONE "PRC";
Click OK.
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.