split_part

Description

Splits a given string at a specified character and returns the requested part. Part is 1-based. If part is a negative value, the parts are counted backward from the end of the string. If any parameter is null, this function returns null.

Return type

string

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

split_part( value, delimiter, part )

Argument

Type

Required

Multiple

Constant

value

string

Required

Only one

Variable

delimiter

string

Required

Only one

Constant

part

int64

Required

Only one

Variable

Examples

split_part("03/04/2021", "/", 2)

This splits the given string by slashes, returning item number 2, which is “04” (one-based indexing.)