> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# SplitPart

The **SplitPart** function splits a string into multiple parts at the position of a specified **delimiter** in the string, then returns the nth part, where n is the **position**.

**SplitPart** allows you to extract portions of a string defined by a repeating pattern, such as words between spaces, or values in a JSON string.

This function isn't compatible with all data platform connections. To check if your connection supports it, see [Supported data platforms and feature compatibility](/docs/region-warehouse-and-feature-support#supported-data-platforms-and-feature-compatibility).

## Syntax

```
SplitPart(string, delimiter, position)
```

**string** (required) - The source string to be split.

**delimiter** (required) - The substring to split the string on. The **delimiter** is excluded when splitting the **string** into parts.

**position** (required) - The index of the part to return. When searching the string for the delimiter, the string is broken into parts each time the delimiter is found. These parts are numbered from left to right, starting with 1. Negative numbers for the index will start counting the index from the right.

## Considerations

* Functionality in edge cases varies by data platform:
  * When using an empty string `""` as the **delimiter** and the **position** `1`, some platforms return the original **string**, while others return an empty string `""`.
    * Example: `SplitPart("abc", "", 1)` can return `"abc"` or `""`.
  * When the **delimiter** is not found in the **string**, some platforms return `null`, while others return an empty string `""`.
    * Example: `SplitPart("a-b-c", "_", 2)` can return `null` or `""`.
  * When the **position** is `0` or out-of-bounds (the absolute value of the **position** is greater than the number of parts), some platforms return `null`, while others return an empty string `""`.
    * Example: `SplitPart("a-b-c", "-", 4)` can return `null` or `""`.
* Cached values can result in unexpected outputs, particularly after implementing a formula that contains one of the limitations described above. If you see unexpected results, click <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/refresh.svg" alt="" /> **Refresh data** to confirm they are not caused by caching.

## Example

```
SplitPart("{index1, index2, index3, index4}", ", ", 3)
```

Splits the string `"{index1, index2, index3, index4}"` into four parts at each appearance of the delimiter `", "`, then returns the third part, `"index3"`.

```
SplitPart("quick brown fox", " ", 1)
```

Splits the string `"quick brown fox"` into three parts at each appearance of the delimiter `" "`, then returns the first part, `"quick"`.

```
SplitPart("quick brown fox", " ", -1)
```

Splits the string `"quick brown fox"` into three parts at each appearance of the delimiter `" "`, then returns the last part, `"fox"`.

```
SplitPart(SplitPart(Text([CustomerJSON]), ",", 3), ":", 2)
```

Parses the JSON string in the `[CustomerJSON]` column to extract the third key-value pair, `CUST_ADDRESS`, then parses the key-value pair to extract the value of the `CUST_ADDRESS` key.

![A table with columns CustomerJSON and SplitPart of CustomerJSON shows several records split to the CUST\_ADDRESS key-value pair and then to the value of the CUST\_ADDRESS key](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/ffd02762fd2f0c2334e2cffbb2bfb1a2e01404e3986dc90bf30618bff7683d42/assets/docs-images/6d64ac1-mceclip1.png)

## Related resources

* [Find](/docs/find)
* [Replace](/docs/replace)
* [RegexpExtract](/docs/regexpextract)