percentile
relationalai.semantics.std.aggregates
percentile(p: int | float, *args: AggValue) -> AggregateCompute the p-th percentile of values, interpolating linearly between
the two closest ranks (matches SQL’s PERCENTILE_CONT).
Parameters
(pint|float) - The percentile to compute, in the range [0, 100]. Must be a literal.
(*argsAggValue, default:()) - Values to compute the percentile over.
Returns
Aggregate- AnAggregaterepresenting the computation of the percentile. Always returnsFloat.
Examples
Compute the 90th percentile of order amounts:
select(aggregates.percentile(90, Order.amount))Compute the 90th percentile of salaries per department:
select(Department, aggregates.percentile(90, Employee.salary).per(Department))