Tableau - String Calculations


In this chapter, you will learn about calculations in Tableau involving Strings. Tableau has many inbuilt string functions, which can be used to do string manipulations such as - comparing, concatenating, replacing few characters from a string, etc. Following are the steps to create a calculation field and use string functions in it.

Create Calculated Field

While connected to Sample superstore, go to the Analysis menu and click ‘Create Calculated Field’ as shown in the following screenshot.

Create calculation

Calculation Editor

The above step opens a calculation editor which lists all the functions that is available in Tableau. You can change the dropdown value and see only the functions related to strings.

string calc 1

Create a Formula

Consider you want to find out the sales in the cities, which contain the letter “o”. For this, create the formula as shown in the following screenshot.

string calc 2

Using the Calculated Field

Now, to see the created field in action, you can drag it to the Rows shelf and drag the Sales field to the Columns shelf. The following screenshot shows the Sales values.

string calc 3
Advertisements