Splits the range from the minimum to the maximum value into a number of equal-width buckets and returns the 1-based bucket a value falls in. Returns 0 for a value before the range and the number of buckets plus one for a value after it. If the minimum is greater than the maximum, the buckets are numbered from the minimum down. Returns null if the number of buckets is not positive or is the maximum long, if the bounds are equal or not finite, or if the value is not a number.
Expression categories: Numeric
Declared arguments
Expression: Number to find the bucket of. Expression<Numeric>
Maximum value: End of the bucketed range. Expression<Numeric>
Minimum value: Start of the bucketed range. Expression<Numeric>
Number of buckets: Number of buckets to split the range into. Expression<Byte | Integer | Long | Short>
Output type:Long
Examples
Example 1: Base case
Description: The second value is before the range and the third after it. The fourth range runs down from its minimum.