Computes the 0-based index value for an array element in the specified column, array literal, or function that returns an array.

Array literal reference example:

derive type:single value:ARRAYELEMENTAT([A,B,C,D],2)

Output: Returns the third value in the array, which is C

Column reference example:

derive type:single value:ARRAYELEMENTAT(myArrays,9) as:'10th_myArrays'

Output: Generates the new 10th_myArrays column containing the tenth element of the arrays listed in the myArrays column.

Array function example:

derive type:single value:ARRAYELEMENTAT(CONCAT([colA,colB]),3) as:'strArrayElementAtIndex'

Output: Generates the new  strArrayElementAtIndex  column containing the fourth element of the concatenated array

derive type:single value:ARRAYELEMENTAT(array_ref,int_index_ref)

ArgumentRequired?Data TypeDescription
array_refYstringName of Array column, Array literal, or function returning an Array to apply to the function
int_index_refYinteger (non-negative)Index value for the array element to return

array_ref

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

 

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

int_index_ref

Non-negative integer value representing the index value of the array element to return.

Usage Notes:

Required?
Data Type
Example Value
YesInteger (non-negative)5


Example - Student progress across tests