Skip to main content
Skip to main content

quantilesExactHigh

quantilesExactHigh

Introduced in: v20.8.0

Exactly computes multiple quantiles of a numeric data sequence at different levels simultaneously. For an even number of elements at level 0.5 it returns the higher of the two middle values.

This function is equivalent to quantileExactHigh but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.

Syntax

quantilesExactHigh(level1, level2, ...)(expr)

Parameters

  • level — Levels of quantiles. One or more constant floating-point numbers from 0 to 1. We recommend using level values in the range of [0.01, 0.99]. Float*

Arguments

Returned value

Array of quantiles of the specified levels in the same order as the levels were specified. For numeric data types the output format matches the input format. Array((U)Int*) or Array(Float*) or Array(Decimal*) or Array(Date) or Array(DateTime) or Array(DateTime64)

Examples

Computing multiple exact high quantiles

SELECT quantilesExactHigh(0.25, 0.5, 0.75)(number) FROM numbers(10)
┌─quantilesExactHigh(0.25, 0.5, 0.75)(number)─┐
│ [2,5,7]                                     │
└─────────────────────────────────────────────┘