Edit Data Sources

To enhance the functionality of your workbook, modify the data source it relies on. By editing your data source, you can accomplish various tasks, such as adding tables through a join operation. For a detailed understanding of common editing tasks, see these resources:

  • Add tables to your data: Learn how to combine multiple tables(Link opens in a new window) in your data source to gain comprehensive insights and make more informed analyses.
  • Connect to a Custom SQL Query (Tableau Desktop): Discover how to Connect to a Custom SQL Query to use the power of SQL to extract and manipulate data according to your specific requirements.
  • Use a Stored Procedure (Tableau Desktop): Gain insights when you Use a Stored Procedure, allowing you to execute predefined sets of actions or calculations on your data.

How to edit the data source

  1. From any worksheet, on the Data menu, select a data source.

  2. Select Edit Data Source.

  3. On the data source page, make the changes to the data source. The data table updates with the data from the new data source.

Connecting to a data source on Tableau.


Within the Data Source page, you’re provided with options to analyze and visualize your data. One of these options is sorting, which enables you to arrange your data in a structured manner. By sorting columns and rows, you can easily organize and make sense of the information at hand.

Sort columns

Sorting columns is a simple and efficient way to bring order to your data. Whether you prefer to sort them based on table or data source, the process is straightforward. In the grid, you can sort columns by accessing the Sort fields dropdown list and selecting the desired sorting option.

A dropdown menu showing the data source order options.

Note: A modified sort state can occur when some tasks cause new columns to be added to the grid.

Sort rows

To arrange rows in a specific order, simply use the sort button. Give it a single click to sort rows in ascending order. For descending order, click the sort button once more. To remove the selection, click the sort button again.

A dropdown list of customer names, sorted alphabetically in ascending order.

Change and reset field names

In Tableau, it’s crucial to have clear and meaningful column (field) names for effective data analysis and visualization.

Rename a field

To rename a field in Tableau:

  1. Find the field whose name you want to change.
  2. Double-click on the current name.
  3. Enter the new name for the field.
  4. Press Enter or click outside the field to save the changes.

Customer Name sorted by ascending order.

Reset names

If you have made changes to a field name and want to revert to the original name, Tableau provides a reset option:

  1. Click the field dropdown menu.
  2. Select Reset Name.

The name will be reset to its original name as specified in the underlying data.

A dropdown menu with Reset Name selected.

Revert automatic name changes

The Revert command will reset any field names that have been automatically modified by naming improvements in Tableau. For more information, see Understand Field Type Detection and Naming Improvements(Link opens in a new window).

Create calculations.

Calculations allow you to perform complex data manipulations and get new insights from your existing dataset. Tableau offers three primary types of calculations:

  • Basic expressions
  • Level of Detail (LOD) expressions
  • Table calculations

For help on choosing which calculation to use, see Choosing the Right Calculation Type.

You can create calculations, groups, or bins based on existing fields in the data source. To start, click the column dropdown arrow and select one of the options.

Note: If you create an aggregate calculation, the values shown in the grid aren’t meaningful until the calculation is used in the context of the view’s level of detail.

A drop-down menu shows selected choice to create a calculated field.

View extract data

When using the Web Data Connector, you can view the extracted data in the grid. This includes extract-only calculations such as MEDIAN. It’s important to note that when in Extract mode, the order of rows in the data source may differ from the order of rows in Live mode.

View showing extract calculations for MEDIAN sales.

Copy values

To copy values in the grid, follow these steps.

  1. Select the desired values.
  2. Right-click on the selected values.
  3. Select Copy from the menu.

Examine your semantics

Use the metadata grid within Tableau to analyze and modify the semantics of your data source. The grid offers a way to assess the columns in your data and their respective data types. You can carry out routine management tasks such as column renaming, hiding, altering data types, and modifying the geographical role of a column.

Note: When dealing with cube data sources, the specific semantics management tasks may differ.

Default semantics view

After you have successfully configured your data source, the information will appear in the grid. When connecting to a cube (multidimensional) data source, the data will be automatically presented. The default view can be different for alternative data source types like Salesforce or Tableau data extracts.

Review semantics

The metadata grid shows the columns from your data source as rows, providing essential information about each column. This includes the data type of the column, the field name in Tableau, and the remote field name.

Manage semantics

Depending on the type of data you're connected to, you can perform tasks like hiding multiple columns at once or quickly renaming columns.

Change the location of your data source in a workbook

As you work with data in your workbook, there may come a time when you need to change the location of your data source. Whether the name or location of the data source has changed, or you want to apply your analysis to a similar data source, this section will walk you through the process of redirecting your workbook to the correct location without losing any of your work.

Change the location of a data source

  1. Right-click the data source you want to edit in the data pane.
  2. From the menu, select Edit Connection.
  3. In the Edit Connection dialog box, you have two options:
    • Go to the new location of the data source by browsing your computer's file system.
    • Select a new data source altogether by clicking on the Browse button and choosing a different file.
  4. After you’ve selected the new location or data source, select OK to save the changes.

A Tableau window showing a connection to a Microsoft Excel file.

Replace field references

When you replace a data source, all worksheets in the workbook that were using the original update to the new data source. However, if the new data source doesn't have the same field names as the original, the invalid fields are marked with an exclamation point. To resolve this issue, replace the references of these fields.

Let's say you have a workbook connected to a data source that includes a field called "Customer Name." You replace the data source and one of its field names is "Name." In this case, the "Customer Name" field will still appear in the Data pane, but it's marked as invalid.

To make the field valid again, replace its references. This means you can map the invalid field to a valid field in the new data source. Here, map "Customer Name" to "Name."

Data source fields.

Replace field references

  1. Right-click (or control-click on a Mac) the invalid field in the data pane.
  2. Select Replace References.
  3. In the Replace References dialog box, choose a field from the new data source that corresponds to the invalid field.

Field context menu with option to replace references.

Rename the data source

When you establish a connection to a data source in Tableau Desktop, you’ll be prompted to give it a name. This name is used to identify the data source within Tableau and can be helpful when you have multiple data sources in a single workbook. It allows you to keep track of the specific details of each connection.

Rename a data source

  1. Go to the Data menu.
  2. Select Rename.

By naming your connections appropriately, you can easily distinguish between different data sources and manage them efficiently. You can also review the properties of a connection by selecting the data source on the Data menu and selecting Properties.

Edit connection options on the data source pane.

Duplicate the data source (Tableau Desktop)

Sometimes you’ll want to make changes to a data source such as add more tables, hide and show fields, or set field defaults. When you make these changes it affects all sheets that use the data source. You can duplicate the data source so you can make the changes without affecting the existing sheets. To duplicate a data source in Tableau Desktop, follow these steps:

  1. Open your workbook in Tableau Desktop.
  2. Go to the Data menu at the top of the screen.
  3. Select the data source that you want to duplicate.
  4. From the dropdown menu, choose Duplicate.

Note: After you duplicate a data source, the name of the duplicate will have "copy" appended to it. This ensures that you can differentiate between the original and the duplicate source.

Duplicating a data source and dragging it onto a canvas.

Thanks for your feedback!Your feedback has been successfully submitted. Thank you!