What do you do when the values of your dimension have a wrong name or a typo?
You use aliases.
Here are two ways to assign an alias to a data value.
Short of time? Scroll to the bottom for the short version.
Tableau pulls the data fields and their values from the data source. However, these are not always the names that you would like them to have. Fortunately Tableau offers a way to change the name of a data field and of its values. The latter is achieved through aliases.
Aliases are alternate names for data values of a dimension in a view. It is important to stress that they can only be created for the categories of discrete dimensions. They cannot be created for continuous dimensions, dates, or measures.
Let’s say you have a dimension with wildlife animal categories and the number of times that they were struck by an aircraft.
You want to replace the name ‘Terrestrial Mammals’ with ‘Land animals.’
There are two ways to make this change; from the Data pane and from the View.
First method: Assign an alias from the Data pane
- Right-click on the field containing the data values in Data pane and choose Aliases. This opens a modal.
2. The modal shows all original data value names on the left and the aliases on the right. To assign an alias, click on the data value on the right to change the name to a text field.
3. Type in the alias and hit Enter. An asterisk (*) will appear under the Has Alias column to indicate that this data value has an alias assigned to it.
Once one or more aliases have been assigned to the dimension, the Clear Aliases button becomes active. Use this button to remove all aliases and return the data values to their original names.
You will see that the name of the data value has changed in the View!
Second method: Assign an alias from the View
- Right-click on the data value in the View and choose Edit Alias. This opens a modal.
2. The modal shows the current data value name or alias. To assign an alias, simply type in the new name and hit OK.
You can see the change immediately in the View.
When should you use which method? The first method using the data field in the Data pane shows a full list of the date values of that field, which is useful to assign multiple aliases at once. The second method assigns an alias to a single data value which is useful to make a quick change on the go. But other than that, both methods work the same and it is up to your preference.
When you go to the preview of the data in the Source Data page, you see that there is a checkbox on top of the table where you can choose to show the aliases or not. It is checked by default. Irrespective of whether the checkbox is checked or not, the alias works only in Tableau and does not change the name of the data value in the data source.
The short version
There are two ways to assign an alias to a data value:
1. To assign an alias to multiple data values at once: Right-click on the data field in the Data pane and choose Aliases.
2. To assign an alias to a single data value: Right-click on the label in the View and choose Edit alias.
Questions? I love questions! Please leave them in the comments below and I will get back to you as soon as I can.
Disclaimer: I am in no way affiliated with Tableau.
This article is based on Tableau Public 2021.1 and uses the FAA Wildlife Strikes, 2015 dataset provided by Tableau.