Skip to content

Count

aggregating category: aggregation no `||`

Returns the number of non-NULL values among the given parameters or inputs, counting ARRAY elements individually.

Without parameters, Count counts every available input. When parameters are given, it counts only those parameters/fields. An ARRAY input is counted element-by-element (the same way Min/Max/Sum fold arrays), so GetCDMTableId(@idx, :key)[] => Count() returns how many rows matched.

NULL values and NULL ARRAY elements are NOT counted — Count is the number of present (non-NULL) values, mirroring SQL COUNT(expr). The result is always INT. Any value type is accepted (it is only tested for NULL, never compared).

Parameters

Nitems Optional — accepts: field, BOOLEAN, DATE, FLOAT, INT, STRING

The Nth value to count. May be a field reference (scalar or ARRAY) or a static value.

Input type

  • BOOLEAN
  • DATE
  • FLOAT
  • INT
  • STRING
  • ARRAY

Output type

  • INT

Examples

Count all inputs

Count()

Count a collected ARRAY

GetCDMTableId(@line_index, :claim_id, :amount)[] => Count()

See also

Sum, Size, Min, Max