Edit Data Sources
At any time during your analysis you can edit the data source used in the workbook.
How to edit the data source
On the Data menu, select a data source, and then select Edit Data Source.
On the data source page, make the changes to the data source.
You might want to edit the data source to:
Connect to a Custom SQL Query (Tableau Desktop)
Use a Stored Procedure (Tableau Desktop)
Navigate the Data Grid
The following enhancements made to the grid on the Data Source page help you better see the data in your data source and prepare it for analysis.
Sort columns and rows
Sort columns: Sort columns in the grid and metadata grid by selecting a sort option from the Sort fields drop-down list. Sort the columns by table or data source order.Sort rows: Sort rows by clicking the sort button. Click the sort button once to sort rows in ascending order, click the sort button again to sort rows in descending order, and then click the sort button a final time to clear the sort.
Change or reset field names
Rename column: Double-click the name of the column to rename the field.
Reset name: If you've renamed a field, click the column drop-down menu, and then select Reset Name to revert back to the original name of the field. You can also select multiple columns and perform the same action.
.
Create new columns and see extract data
Create new calculations: Create new calculations, groups or bins based on existing fields in the data source. Click the column drop-down arrow and select one of the respective options.
See extract data: For the Web Data Connector, file- and relational-based data sources in Extract mode, you can see extract data in the grid, including extract only calculations like MEDIAN.
Copy values
Copy values: Copy values in the grid by selecting the values and then pressing Ctrl+C (Command-C on a Mac). Alternatively, to copy values in the metadata grid, select the values, right-click, and then select Copy.
Examine your Metadata
Use the metadata area to quickly examine and change the structure of the Tableau data source. You can use the metadata area to review the columns in your data and their data types, do routine management tasks such as renaming a column, hiding a column, changing the data type of a column and changing the geographical role of the column.
Note: Metadata management tasks vary when working with a multi-dimensional data source.
Go to the metadata area
After you have set up your data source, click the metadata area button. If you are connected to a cube (multidimensional) data source, the metadata area is shown by default. For other data source types, such as Salesforce or Tableau data extracts, the default view will vary.
Review metadata
The columns of the data source are represented as rows in the metadata area. Each row shows the data type of the column, the column name in the Tableau data source, the name of the table in the underlying data from which the column comes and the name of the column in the underlying data.
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. For example, to hide multiple columns at once, press the CTRL or Command key, select the columns you want to hide, click the drop-down arrow next to a column name and then select Hide. Changes that you make in the metadata area of the data source do not modify your underlying data.
Change the Location of the Data Source
When you edit a data source, you have the option of changing the location of the data source. For example, suppose the name or location of a data source you were using has changed and is no longer available using the previous connection information. In this case, you can direct the workbook to the correct location without losing your work.
You can use this same method to apply analyses performed on one data source to a similar data source. Suppose you create a workbook containing several views involving markets, products, sales and profits and you want to apply the analyses to a new data source. Instead of recreating each view, you can edit the original data connection and specify a new data source.
To change the location of a data source
Right-click (control-click on a Mac) the data source in the Data pane and then select Edit Connection.
In the Edit Connection dialog box, navigate to the location of the data source or select a new data source.
Replace Field References
When you successfully connect to a new data source, all worksheets in the workbook that previously referred to the original data source now refer to the new data source. If the new data source does not have the same field names as the original workbook, the fields become invalid and are marked with an exclamation point . You can quickly resolve the problem by replacing the field’s references.
For example, say you have a workbook connected to a data source that contains a Customer Name field. Then you edit the data source to point to a new data source that has all the same data but instead of Customer Name, the field name has been changed to Name. The Customer Name field remains in the Data pane but is marked as invalid. To make the field valid, you can replace the references, which means you can map the invalid field to a valid field in the new data source (for example, Customer Name corresponds to Name).
To replace field references
Right-click (control-click on a Mac) the invalid field in the Data pane and then select Replace References.
In the Replace References dialog box, select a field from the new data source that corresponds to the invalid field.
Rename the Data Source
When you connect to a data source, you are given the option to give it a name for use in Tableau Desktop.
To rename the data source
- On the Data menu, select Rename.
Naming a connection is useful when you have a single workbook connected to many data sources. The name you assign can help you keep track of the specifics of the connection. You can also review the connection properties by selecting a data source on the Data menu, and then selecting 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, set field defaults, and so on. When you make these changes it affects all sheets that use the data source. You can duplicate the data source so that you can make the changes without affecting the existing sheets.
To duplicate a data source
- On the Data menu, select a data source and then select Duplicate.
When you duplicate a data source, the duplicate source name has “(copy)” appended to the end.