quantilesExactWeightedInterpolated
quantilesExactWeightedInterpolated
Introduced in: v24.10.0
Computes multiple quantiles of a numeric data sequence using linear interpolation at different levels simultaneously, taking into account the weight of each element.
This function is equivalent to quantileExactWeightedInterpolated but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.
Syntax
Parameters
level— Levels of quantiles. One or more constant floating-point numbers from 0 to 1. We recommend usinglevelvalues in the range of[0.01, 0.99].Float*
Arguments
expr— Expression over the column values resulting in numeric data types,Date,DateTimeorDateTime64.(U)Int*orInt128orUInt128orInt256orUInt256orFloat*orDecimal*orDateorDateTimeorDateTime64weight— Column with weights of sequence members. Weight is a number of value occurrences.UInt*
Returned value
Array of quantiles of the specified levels in the same order as the levels were specified. Numeric arguments produce Float64, while Decimal, Date, DateTime and DateTime64 arguments keep their input format. Array(Float64) or Array(Decimal*) or Array(Date) or Array(DateTime) or Array(DateTime64)
Examples
Computing multiple exact weighted interpolated quantiles