Menu
Amazon QuickSight
User Guide

split Function

split splits a string into an array of substrings, based on a delimiter that you choose, and returns the item specified by the position.

Syntax

Copy
split(expression, delimiter , position)

Arguments

expression

The expression must be a string. It can be the name of a field that uses the string data type, a literal value like '12 Main Street;1402 35th Ave;1818 Elm Ct;11 Janes Lane', or a call to another function that outputs a string.

delimiter

The character that delimits where the string is broken into substrings. For example, split('one|two|three', '|', 2) becomes the following.

Copy
one two three

If you choose position = 2, split returns 'two'.

position

(Optional) The position of the item to return from the array. The position of the first item in the array is 1.

Return Type

String array

Example

The following example splits a string into an array, using the semicolon character (;) as the delimiter, and returns the third element of the array.

Copy
split('123 Test St;1402 35th Ave;1818 Elm Ct;11 Janes Lane', ';', 3)

The following item is returned.

Copy
1818 Elm Ct

This function skips items containing null values or empty strings.