# The Split function in Tableau.

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-03-11
- **Format:** Video · 9 min watch · transcript available
- **Topics:** Data prep, Data visualisation
- **Tools:** Tableau (calculated fields, data prep, split)
- **Canonical:** https://just-tim.com/posts/the-split-function-in-tableau
- **Watch:** https://www.youtube.com/watch?v=v0BKzgDp218

I show you how to use the split function in Tableau, one of the most important string functions. I demonstrate Tableau's automatic transform-and-split feature, explain the calculation it writes behind the scenes, then walk you through writing your own splits to break a comma-delimited field into a hierarchy.

## Key takeaways

- Right-click a field and choose Transform > Split to let Tableau automatically detect the delimiter and create split fields as calculated fields
- The split syntax is SPLIT(field, delimiter, token number) where the number targets which instance of the delimiter to extract up to
- When a delimiter isn't found, split returns the entire original string rather than nulling it out
- Wrapping a numeric split in INT() makes the resulting calculation more efficient when used elsewhere
- Use the custom split option to target a delimiter, choose how many columns to extract, and break a single text field into a full hierarchy

## Chapters

- 0:00 What the split function does
- 0:20 Automatic transform and split
- 1:37 Reading the generated calculation
- 2:51 Writing your own split on a comma
- 5:10 Extracting later items in a hierarchy
- 7:05 Using custom split for full hierarchies

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/the-split-function-in-tableau

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
