ARRAYLEN
ARRAYLEN
takes an array of objects as a parameter and returns the length of the array as an integer.
Syntax
int ARRAYLEN(object[] values)
Example
Suppose you have a column named ArrayColumn in your data set, which contains arrays of objects of varying lengths. For instance, one of the rows in ArrayColumn might contain the values [1;"two";true], while another row might contain only one value.
To calculate the number of items in each array, you can use the ARRAYLEN
function which takes an array of objects as input and returns the number of elements in the array.
For example:
ARRAYLEN(ArrayColumn)
Would return 3, as there are three items in the array.
ARRAYLEN
works for arrays of any length and any data type. This means that you can use it to process your data regardless of how your arrays are structured. Simply pass the array column to ARRAYLEN
, and the function will calculate the length for each row in the column.