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)
On the Data menu, select a data source.
Select Edit Data Source.
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.
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.
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:
- Locate the column whose name you wish to change.
- Double-click on the current name of the column.
- Enter the desired new name for the field.
- Press Enter or click outside the field to save the changes.
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.
- Click on the column dropdown menu.
- 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).
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.
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.
To copy values in the grid, follow these steps.
- Select the desired values.
- Right-click on the selected values.
- Choose Copy from the menu.
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.
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.
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.
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
- Right-click (control-click on a Mac) the data source you wish to edit in the data pane.
- From the menu, select Edit Connection.
- 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.
- After you have selected the new location or data source, select OK to save the changes.
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
- Right-click (or control-click on a Mac) the invalid field in the data pane.
- Select Replace References.
- In the Replace References dialog box, choose a field from the new data source that corresponds to the invalid field.
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
- Go to the Data menu.
- 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.
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:
- Open your workbook in Tableau Desktop.
- Go to the Data menu at the top of the screen.
- Select the data source that you want to duplicate.
- 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.