Tableau Data Source

What is Tableau data source?

Tableau data source is a physical source of data that may contain a file name, location, any database connection, or table joins, including the associated metadata. Tableau data source provides a tool to connect with a wide range of data sources using the Tableau interface, which includes 

  • File-based sources (Text, CSV, Excel, JSON, PDF, Microsoft Access, Spatial File, Statistical File, etc.).
  • A wide range of database options (Oracle, MySQL, PostgreSQL, SQL Server etc.)
  • Big data/cloud platforms (Amazon web services, Google BigQuery, Microsoft Azure, etc.)
  • ODBC connectivity.
  • Tableau/ other servers.

Tableau provides a list of data sources that you can connect using the interface, i.e., New Data Source, as shown below. Depending on the Tableau license you have, you may see more data source options on the Tableau desktop.

Tableau Data Source - Intro
Key Takeaways
  • Tableau data source is an important tool that allows you to connect with a wide range of data sources including file-based sources, databases, cloud platforms, Tableau servers, or other sources for data visualization.
  • You can connect to multiple data sources in Tableau using File Navigator or the New Data Source interface.
  • Tableau provides different functionalities to edit, replace, or remove data sources.
  • You can also perform Tableau data source blending using primary and secondary data sources in Tableau.
  • You can publish Tableau data sources to the Tableau server or Tableau cloud and you can set up authentication mechanisms for the data sources.

How to Connect to data sources in Tableau?

To connect to a data source in Tableau, follow the step-by-step instructions outlined below:

Step 1: Navigate to the Data Source tab in Tableau Desktop.

Step 2: Click on File – Open. 

Tableau Data Source - Connect - Step 2

Step 3: Choose your data source to connect from your system. Tableau will automatically connect with the selected data source.

Alternatively, you can also connect to data sources by navigating to select Data – New Data Source.

Tableau Data Source - Connect - Step 3

Choose your data source from the available data source options, i.e., Excel, text, JSON, Microsoft Access, pdf, any database server, etc.

Tableau Data Source - Connect - Step 3 - Options

Note: Depending on the Tableau license, you can find various data source options in Tableau Desktop.

How to Connect to a Custom SQL Query?

A custom SQL query can be used to perform activities such as table union, cross-database joins, table alteration, or data size reduction in Tableau.

To connect to a custom SQL Query in Tableau, follow the steps highlighted below:

Step 1: Connect your dataset to the Tableau interface.

Step 2: Double-click on the New Custom SQL option on the Data Source tab in Tableau.

SQL Query - Step 2

Step 3: Specify the custom SQL query in the Custom SQL text box. You can specify SQL query 

SELECT * FROM EMPLOYEES UNION ALL SELECT * FROM MANAGERS

Step 4: Click on OK to save your changes.

Tableau will now run the SQL query, and a Custom SQL Query screen will be displayed in the logical layer of the canvas. It will display the relevant fields as per the custom SQL query specified in the text box.

Tableau Data Source - SQL Query - Step 4

How to edit data sources in Tableau?

In this section, we will look at editing the data sources in Tableau.

To edit data sources in Tableau, follow the instructions highlighted below:

Step 1: Navigate to a new or an existing worksheet in Tableau.

Step 2: In the Data pane, right-click on a data source and select Edit Data Source from the context menu.

Tableau Data Source - Edit - Step 2

Alternatively, you can also edit your data source by navigating to Data – <Data source> – Edit Data Source.

Tableau Data Source - Edit - Step 2 - Edit source

Tableau will navigate you to the Data Source tab.

Step 3: Amend any data changes you want to perform on the data source.

Tableau Data Source - Edit - Step 3

Step 4: Sort the fields by accessing the sort fields dropdown list and choosing the required option in the grid. 

Tableau Data Source - Edit - Step 4

Step 5: You can sort the rows as per your desired order by clicking on the sort icon.

Tableau Data Source - Edit - Step 5

Step 6: Amend column names or reset columns using the Rename option.

Tableau Data Source - Edit - Step 6

Step 7: You can also create aliases, create calculated fields, and create groups for the data columns.

Step 8: Similarly, you can split or custom split the column values.

For example, you can specify the separators to split the column values in your data source.

Tableau Data Source - Edit - Step 8

Step 9: Additionally, you can edit your data connection or rename the data source using the option as shown below.

Tableau Data Source - Edit - Step 9

How to publish the data source to the Tableau server?

To publish Tableau data source to a Tableau server, follow the steps highlighted below:

Step 1: In the Tableau Desktop, navigate to a worksheet and select Server – Publish data source.

Tableau Data Source - Publish - Step 1

Step 2: In the Published Data Source screen, specify the choices.

  • Choose the project you want to publish Tableau data source and specify the data source details for the Project.
  • In the Description and Tags section, add a description and provide tags for the project so that the users can quickly identify it. You can use separate tags, i.e., a comma or space to add a tag.
  • For the Refresh Schedule, you can specify a refresh schedule for your data extraction to update the Tableau data source. Otherwise, you can also choose a post-publish schedule from the Tableau server.
  • Use default project settings to specify permissions.
  • Specify the choice of authentication for publishing the data to the Tableau server by defining the requirement of providing credentials for data access.
Tableau Data Source - Publish - Step 1 - authentication

Note that data authentication choice is dependent on the type of data you intend to publish Tableau data source and the target location, i.e., Tableau Server or Tableau Cloud.

Step 3: For publication of a file-based data source available on a Windows network drive or data source using image files from a local system, select the Include external files option.

This option will ensure that file copies are placed on the Tableau server. So when you publish the extracts of multi-connection data sources containing a connection to file-based data such as Text, CSV, or Excel, they are included in the data source.

Step 4: During the publishing process, Tableau automatically updates the workbook connection to use the newly published data source while closing the local source.

You can clear the Update workbook to use the published data source check box to continue using the local data source.

Tableau Data Source - Publish - Step 2

Step 5: Click on the Publish button to finish the publication process.

Post-publication, an Ask Data screen is opened in the web browser for the published data source where you can ask any questions to automatically build views or vizzes.

Step 6: You can define the refresh schedule on the Tableau server to update the Tableau data source.

LIVE vs EXTRACT Data Sources in Tableau

Live Data Source: 

  • Data Sources connected using LIVE connections in Tableau will query the underlying data in the data sources directly every time they interact with the data.
  • It means that at any point in time, you will always have access to real-time data.
  • When you use a LIVE connection, data is not copied to the Tableau server for any pre-processing.
  • However, using a LIVE connection for a very large dataset can lead to lower query performance in your data visualization.

EXTRACT Data Source:

  • When you use EXTRACT data sources in Tableau, essentially, you are using a static or a local copy of the data source. With EXTRACT data sources, Tableau creates a compressed snapshot of data stored locally and loads it into Tableau memory that can be rendered into a data visualization as needed.
  • Using EXTRACT data sources will mean you may not have access to the real-time data, and hence, you will need to define a refresh schedule to entirely copy the latest extract to refresh or update the Tableau data source. 
  • EXTRACT data sources can result in much faster results and enhanced query performance compared to LIVE data sources, especially for large or complex data sources, Tableau data source filters, calculations, etc. It is because Tableau’s in-memory data engine directly runs the queries on the extracts.

Whether you want to use LIVE or EXTRACT data sources, the choice depends on

  • The data volume and complexity of the dataset
  • How frequently do you want to refresh your dataset?
  • Data performance requirements

Important Things to Note

  • Choosing the right data connection type i.e. Live vs Extract is important for data visualization in Tableau. It is recommended that you compare the performance implications and data volume to choose the right option for your visualization.
  • Always ensure that the data refresh schedule is specified to maintain your data up-to-date.
  • Consider setting up the right permissions and authentication methods to ensure that only intended users access the data sources.
  • Organize your data sources by specifying the data model and relationships.

Frequently Asked Questions (FAQs)

1. How to replace the data source in Tableau?

To replace the data source in Tableau, you may follow the below steps.

Step 1: Import a data source to Tableau Desktop using File – Open.

Step 2: Navigate to a new or existing worksheet. In the Data pane, right-click on a data source and select Replace Data Source option from the context menu.

FAQ 1

Step 3: Select the replacement data source from the drop-down menu and click on OK.

FAQ 1 - Step 3

Tableau will automatically replace the current data source as visible in the Data pane.

FAQ 1 - Step 3 - Data pane

2. How to remove data sources from Tableau?

To remove a data source from Tableau, follow the steps provided below:

Step 1: Navigate to an existing Tableau worksheet.

FAQ 2 - Step 2

3. How to blend data sources in Tableau?

To blend data sources in Tableau, follow the steps below:

Step 1: In your Tableau desktop, import two or more data sources into Tableau. Ensure that the 2nd or secondary data source is added to Tableau via the Data – New Data Source option.

FAQ 3 - Step 1

Step 2: In a new worksheet, drag a data field to the Tableau view. This becomes your primary data source. You can view the green check mark against your primary data source.

FAQ 3 - Step 2
Step 3: Switch to 2nd data source and validate that Tableau displays a blended relationship to the primary data source.

FAQ 3 - Step 3
If you see a broken link () then also you can link the data sources by clicking on the icon. However, if no link is visible, consider defining the blend relationships for Tableau data source blending.

Step 4: Drag a field from the 2nd data source to the view in Tableau.

As you can see the data sources have been blended with the primary being Global Sales Demo and the secondary one being Region with an orange check mark.

FAQ 3 - Step 4

4. How to refresh the Tableau data source?

To refresh the Tableau data source, follow the instructions highlighted below:

Step 1: Right-click on a data source in the Data pane and select the Refresh option from the context menu.

FAQ 4 - Step 1

Alternatively, you can also refresh the Tableau data source by navigating to Data – <Data Source> – Refresh.

Step 2: Tableau will pop up a window asking for confirmation to proceed. Click on Yes to proceed with Tableau data refresh.

FAQ 4 - Step 2

Tableau will refresh the dataset as per your configured data source.

Guide to What is the Tableau Data Source. We explain how to connect, edit and publish data source to SQL server in Tableau, with connecting to a SQL server, examples. You can learn more from the following articles.

Reader Interactions

Leave a Reply

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