numeric →
bucket(
    minimum: numeric,
    maximum: numeric,
    count: integer
) → integer

Classifies a numeric value into an equal-width bucket within a half-open interval. Returns null when the value is outside the interval or the bucket configuration is invalid.

Parameters

Name Type Required Description
minimum numeric Yes Inclusive lower bound of the classified interval.
maximum numeric Yes Exclusive upper bound of the classified interval.
count integer Yes Strictly positive number of equal-width buckets.

Argument evaluation

  • minimum: Evaluated once in the enclosing context.
  • maximum: Evaluated once in the enclosing context.
  • count: Evaluated once in the enclosing context.

Examples

12500 | bucket(5000, 20000, 3)  2

Kind: Function
Scope: numeric/classification
Aliases: None


This site uses Just the Docs, a documentation theme for Jekyll.