From the course: Tableau: Mastering Calculations
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Splitting and replacing strings - Tableau Tutorial
From the course: Tableau: Mastering Calculations
Splitting and replacing strings
Let's continue for a bit with the example of the phone number. Again, our phone numbers consist of an area code and a local number, and these both aspects are separated by a space. Our goal is now to separate the area code and local number. This is easiest with the split feature. Let's take a look. We can right-click on "Phone", and "Transform", and "Split". Or we could also use a custom split. In our case, we want to separate at the space and split off the last column from the end. Let's click "OK" and drag this field into the view. We can see this now contains the local number. But what actually happens behind the scenes? Let's take a deeper look. Let's right-click and edit this new split field. We can see that Tableau uses two functions, SPLIT and TRIM. SPLIT returns a substring from a string as determined by the delimiter. So our delimiter is the space. TRIM will be used to return the string with both leading and trailing spaces removed. So a clean-up function. Let's recreate it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
What does row-level mean?28s
-
Cropping and searching strings5m 34s
-
(Locked)
Splitting and replacing strings5m 42s
-
(Locked)
Concatenating strings1m 55s
-
(Locked)
Truncating date fields5m 10s
-
(Locked)
Calculating simple intervals between two points in time3m 7s
-
(Locked)
Calculating complex intervals between two points in time7m 38s
-
(Locked)
Challenge: Combine fields30s
-
(Locked)
Solution: Combine fields1m 26s
-
(Locked)
-
-
-
-
-
-