In Tableau, the PROPER function is used to convert a string to title case, where the first letter of each word is capitalized, and all other letters are lowercase. It is commonly used to standardize the capitalization of names or textual data in Tableau visualizations and calculations.
The syntax for the PROPER function in Tableau is as follows:
PROPER(string)
Here's an example to illustrate the usage of the PROPER function in Tableau:
Let's consider a dataset with a column called "Customer Name" that contains customer names in various formats and capitalization styles.
Customer Name
john doe
MARY SMITH
Peter Parker
jessica JONES
To convert the customer names to title case using the PROPER function, you can create a calculated field in Tableau:
- Right-click on a blank area in the "Data" pane in Tableau.
- Select "Create Calculated Field."
- In the formula editor, enter the following expression:
PROPER([Customer Name])
- Click "OK" to create the calculated field.
The calculated field, which utilizes the PROPER function, will convert the customer names to title case, where the first letter of each word is capitalized and all other letters are lowercase.
The resulting dataset will be as follows:
Customer Name Proper Name
john doe John Doe
MARY SMITH Mary Smith
Peter Parker Peter Parker
jessica JONES Jessica Jones
As shown in the example, the PROPER function capitalizes the first letter of each word in the "Customer Name" column and converts the remaining letters to lowercase. The resulting column, named "Proper Name," contains the names in title case format.
By using the PROPER function, you can ensure consistent capitalization and improve the readability of textual data in your Tableau visualizations and analyses.
No comments:
Post a Comment
If you have any doubts. Please let me know