Returns an array containing a slice of the input array, as determined by starting and ending index parameters.

Array literal reference example:

derive type:single value:ARRAYSLICE(["A","B","C","D"],1,2)

Output: Generates an output column containing the array: ["B"]. 

Column reference example:

derive type:single value:ARRAYSLICE([myValues],2) as:mySliceOfmyValues'

Output: Generates the new mySliceOfmyValues column containing a slice of the arrays in the myValues, starting at the third value and extending to the end of the array.

derive type:single value:ARRAYSLICE(array_ref,int_start_index,[int_end_index])

ArgumentRequired?Data TypeDescription
array_refYarray or stringName of Array column, Array literal, or function returning an Array to apply to the function
int_start_indexYinteger0-based index value of the first element in the Array to include in the slice.
int_end_indexNinteger

0-based index "soft" value of the last element in the Array to include in the slice. Listed value is not included.

If no value is provided, the last element of the array is the end of the slice.

array_ref

Name of the array column, array literal, or function returning an array whose element you want to locate.

 

Required?Data TypeExample Value
YesString (column reference or function) or array literalmyArray1

int_start_index

Index of the starting element of the source array that you wish to include in the slice.

Required?Data TypeExample Value
YesInteger (whole number)4

int_end_index

Optional index of the ending element of the source array that you wish to include in the slice.

Required?Data TypeExample Value
YesInteger (whole number)10


Example - Podium Race Finishes