Connecting Data Sources in Tableau

  • Read
  • Discuss

There are numerous ways to connect to a Data Source in Tableau. We will look at both basic and advanced connection types. Tableau’s native connectors can connect to the data sources listed below.

Data SourceExample
File SystemsCSV, Excel, Text Files
Relational SystemsOracle, Sql Server, DB2
Cloud SystemsWindows Azure, Google BigQuery
Other SystemsODBC
Data ExtractSnapshot of your data that you can use to improve performance and reduce the time it takes to load your data into Tableau
Big Data SourceHadoop
Cloud SourceAmazon Redshift, Google BigQuery
Web Data ConnectorGoogle Analytics, Salesforce
Table 1: Types of Data Sources to connect to Tableau

Connecting to a Data Server

Database servers, such as SQL Server, Snowflake, Vertica, and Oracle, store, aggregate, sort, and serve data based on requests from client applications. Tableau may use these servers’ capabilities to retrieve data for display and analysis. Data can also be taken from various sources and saved in an extract.

We’ll use SQL Server as an example of how to connect to a server data source. You may want to build a new data source and investigate the details if you have access to a server-based data source.

Sources of relational data Instead of connecting to the complete data source, you can connect to a specific query. This can be handy if you know exactly what information you need and how to write SQL queries.

  1. In the connection dialogue box, select Custom SQL.
  2. In the text field, type or paste the question. For more advanced queries, the button in the upper right corner of the text box opens a larger editing window.
Figure 1: Writing custom SQL query

Connecting to Data in Cloud

Certain data connections are established to data hosted in the cloud. Amazon RDS, Google BigQuery, Microsoft SQL Azure, Snowflake, Salesforce, Google Drive, and many more are examples. Google Sheets allows users to create and manage data spreadsheets online. Many different people can share and collaborate on sheets. Below, figure 2 shows how to connect to tableau with multiple ways.

Figure 2: Ways to connect to Tableau

Managing the Data Source Metadata

Tableau data sources store information about the connection (s). In addition to the connection (for example, database server name, database, and/or filenames), the data source contains information about all available fields (such as field name, data type, default format, comments, and aliases). This data about the data is frequently referred to as metadata.

Data Blending

  • Data blending in Tableau occurs when data is Tableau blended from several data sources and related to common dimensions on a single worksheet.
  • Row-level joins are not created. This is not a method for adding new dimensions or rows to your data.
  • It should be used when you have relevant data from multiple data sources that you wish to evaluate in a single view.
  • To begin combining the data blending tableau, add one of the common dimensions from the primary data source to the view.

Data Blending Components: Primary and Secondary

Data blending is made up of two important components: primary and secondary data sources. The primary data source is the one that is used first in the view, while the secondary data source is the one that is used second. There is a chance that the values from the secondary data will be restricted. This is because the view only displays the data that corresponds to the primary source.

How do you interact across multiple data sources?

When working with many data sources, a few considerations must be made. The following are the two main points:

  • Aggregate: In blended data sources, there are aggregate and non-aggregate arguments. Any field from another data source that is used includes a default aggregation- SUM. This, however, can be altered. However, because the calculations cannot mix aggregate and non-aggregate arguments, the data source fields must be explicitly aggregated.
  • Dot Notation: When using Dot Notation, any field referred to in the calculation that belongs to another data source will refer to that data source.

Data Joining

Various relational data sources are made up of a group of tables that are linked together by specific fields. For example, tableau join data sources for a company may include a table for an employee that includes the individual’s first name, last name, phone number, and so on.

There may also be other tables for titles that include the price, royalties, and title of published books. To study these two Tableau join tables collectively, for example, to answer queries such as how much royalties were paid to a specific employee last year, you would link the two Tableau join tables using a common column such as Employee ID. You can then examine and use fields from both tables in your analysis.

Different ways of loading data into Tableau

Let’s look at some of the ways to load and connect data into our tableau platform.

Loading a CSV or Excel file into Tableau

To import a CSV or Excel file into Tableau, perform the following:

  1. Open Tableau and select the “New” option. From the drop down menu select the “Workbook” option.
  2. Select the “File” tab to upload a CSV or Excel file from the computer.
  3. Once the file has been loaded, you will be asked to choose which sheets and fields to use in your analysis. To create a visualisation, drag and drop fields from the data source onto the “Columns” and “Rows” shelves.

You can see this as an image below:

Figure 3: Steps to load a CSV/Excel file in Tableau

Connect to the database server in Tableau

To connect to a database from Tableau, perform the following steps:

  1. Open Tableau and select the “New” option and press “Workbook”.
  2. Select the “Connectors” tab and then select the type of database to which you want to connect (e.g., MySQL, Oracle, SQL Server).
  3. Enter the connection details for the database you want to connect to in the “Connect” window, such as the server name, port number, and database name. You may be required to provide your username and password as well.
  4. To connect to the database, click the “Sign In” option.
  5. Once linked, you will be invited to choose the tables and fields to utilize in your study. Drag and drop fields from the data source onto the “Columns” section.

You can see this as an image below:

Figure 4: How to connect to database server in Tableau

Leave a Reply

Leave a Reply

Scroll to Top