split(text, delimiter, position) cuts a string at each delimiter and returns the part at the given
position, counting from 1. It is the simplest way to take the domain of an e-mail address or the first
level of a category path, with one restriction: AWS documents it for calculated fields added during data
preparation, not in an analysis.
Copy and paste
In the dataset (data preparation):
Domain of an e-mail address:
split({Email}, '@', 2)
First level of a path such as Food/Fruit/Apples:
split({Category Path}, '/', 1)
Second level:
split({Category Path}, '/', 2)
In an analysis, without split:
Everything before the first delimiter:
left({Category Path}, locate({Category Path}, '/') - 1)
Everything after the first delimiter:
substring({Category Path}, locate({Category Path}, '/') + 1, strlen({Category Path}))
Example
| Category Path | Position 1 | Position 2 | Position 3 |
|---|---|---|---|
| Food/Fruit/Apples | Food | Fruit | Apples |
| Food/Vegetables/Carrots | Food | Vegetables | Carrots |
| Household/Cleaning/Soap | Household | Cleaning | Soap |
Data preparation only
Add the field in the dataset editor with Add calculated field. Every analysis that uses the dataset
then has the part as a normal column, and for SPICE datasets it is computed once at refresh. AWS also
notes that split is not supported in direct queries to Microsoft SQL Server.
When you can’t edit the dataset, use the locate formulas. locate(text, '/') returns the position of
the first /, 1-based, or 0 when there is none. left takes the characters before it, and substring
the characters after it, for a length that is at least as long as what is left.
Rows without the delimiter
A path with no /, such as Gift cards, has no position 2. With the locate formulas, locate
returns 0, so left(..., -1) is not a valid length. Guard the case:
ifelse(
locate({Category Path}, '/') = 0, {Category Path},
left({Category Path}, locate({Category Path}, '/') - 1)
)
Check a few such rows after creating a split field as well, before you build filters on it.
Better in the source
If the delimited column is a list of values, such as tags, splitting it into one row per value belongs in
the source query or the warehouse. QuickSight’s split returns one part per field, so “all products
tagged X” across positions 1 to 5 would need five fields.
Checked against the Amazon Quick Sight function reference (October 2026).