Edit Data Sources

To enhance the functionality of your workbook, you can 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, you can refer to the following resources:

  • Adding tables to your data with a Join: Learn how to combine multiple tables in your data source to gain comprehensive insights and make more informed analyses. To explore this topic further, click on the following link: Join Your Data
  • Connecting to a Custom SQL Query (Tableau Desktop): Discover how to connect Tableau Desktop to a custom SQL query, enabling you to leverage the power of SQL to extract and manipulate data according to your specific requirements. For more information on this topic, please visit: Connect to a Custom SQL Query
  • Using a Stored Procedure (Tableau Desktop): Gain insights into utilizing stored procedures in Tableau Desktop, empowering you to execute predefined sets of actions or calculations on your data. To delve deeper into this subject, access the following link: Use a Stored Procedure (Tableau Desktop)

How to edit the data source

  1. 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.

Within the Data Source page, you are 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.

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 utilize 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.

Change column names and reset field names

In Tableau, it is crucial to have clear and meaningful column names for effective data analysis and visualization.

Rename a column

To rename a column in Tableau, simply follow these steps:

  1. Locate the column whose name you wish to change.
  2. Double-click on the current name of the column.
  3. Enter the desired new name for the field.
  4. Press Enter or click outside the field to save the changes.

Reset names

If you have made changes to a field name and want to revert back to the original name, Tableau provides a reset option. Complete the following steps to reset the name.

  1. Click on the column dropdown menu.
  2. Select the Reset Name.

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

Revert Tableau's automatic name changes

The Revert command will reset any field names that have been automatically modified by Tableau's naming improvements. 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 displayed in the grid aren’t meaningful until the calculation is used in the context of the view’s level of detail.

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 is 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.

Copy values

To copy values in the grid, follow these steps.

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

Examine your metadata

Utilize the metadata grid within Tableau to efficiently analyze and modify the organization of your data source. The metadata 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 multi-dimensional data sources, the specific metadata management tasks may differ.

Default metadata view

After you have successfully configured your data source, the information will be displayed in the grid. In the case of 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 metadata

The metadata grid displays the columns from your data source as rows, providing essential information about each column. For every row, you can find details such as the data type of the column, the field name in the Tableau data source, the name of the physical table in the underlying data source, and the remote field name.

Manage metadata

Depending on the type of data you're connected to, you can perform routine management 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 (control-click on a Mac) the data source you wish to edit in the data pane.
  2. From the menu, select Edit Connection.
  3. In the Edit Connection dialog box, you have two options:
    • Navigate 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 have selected the new location or data source, select OK to save the changes.

Replace field references

When you establish a successful connection with a new data source, all worksheets in the workbook that were previously using the original data source will now be linked to the new data source. However, if the new data source doesn't have the same field names as the original workbook, the fields will be considered invalid and marked with an exclamation point. To resolve this issue, you can easily replace the references of these fields.

For instance, let's say you have a workbook connected to a data source that includes a field called "Customer Name." Later, you modify the data source to connect to a new one that contains all the same data, but the field name has been changed to "Name." In this case, the "Customer Name" field will still appear in the Data pane, but it will be marked as invalid.

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

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.

Rename the data source

When you establish a connection to a data source in Tableau Desktop, you will 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 connected to 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 choosing Properties.

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.

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