COUNT_VALUES_IF
Last updated: 9/8/2026Returns the number of true values in a given array.
This can be used with conditional operators to count the number of array elements that fulfil a condition. For example, COUNT_VALUES_IF(my_values[] > 3) will return the number of elements that are greater than 3.
Syntax
COUNT_VALUES_IF(input)
Arguments
| Name | Type | Description | Default Value |
|---|---|---|---|
| input | Boolean | The input array |
Returns
the number of times true appeared in the input array. a primitive value is considered to be an array with one element.
Examples
| input | Output |
|---|---|
| null::Boolean | 0 |
| array[true, false, true] | 2 |