Reference material for ARRAY_COUNT function
function(array[i])
evaluates to TRUE, if a function is provided.
If <function>
is not provided, counts the number of elements in the array that evaluate to TRUE, equivalent to using x -> x
.
To count the elements in an array without any conditions, use the ARRAY_LENGTH function instead.
Parameter | Description | Supported input types |
---|---|---|
<function> | Optional. A Lambda function used to check elements in the array. If <function> is not provided, x -> x is used. | Any Lambda function returning BOOLEAN |
<array> | An array of elements | Any ARRAY type if <function> is provided, else ARRAY(BOOLEAN) |
INTEGER
1
1
In this example below, there is no <function>
provided in the ARRAY_COUNT
function. This means the function will count all of the elements in the array that evaluate to TRUE. Below, this is the case for all values except FALSE
and null
:
4