> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Exactly computes multiple quantiles of a numeric data sequence at different levels simultaneously, taking into account the weight of each element.

# quantilesExactWeighted

<h2 id="quantilesExactWeighted">
  quantilesExactWeighted
</h2>

Introduced in: v1.1.0

Exactly computes multiple [quantiles](https://en.wikipedia.org/wiki/Quantile) of a numeric data sequence at different levels simultaneously, taking into account the weight of each element.

This function is equivalent to [`quantileExactWeighted`](/reference/functions/aggregate-functions/quantileExactWeighted) but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.

**Syntax**

```sql theme={null}
quantilesExactWeighted(level1, level2, ...)(expr, weight)
```

**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*`](/reference/data-types/float)

**Arguments**

* `expr` — Expression over the column values resulting in numeric data types, `Date`, `DateTime` or `DateTime64`. [`(U)Int*`](/reference/data-types/int-uint) or [`Int128`](/reference/data-types/int-uint) or [`UInt128`](/reference/data-types/int-uint) or [`Int256`](/reference/data-types/int-uint) or [`UInt256`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal*`](/reference/data-types/decimal) or [`Date`](/reference/data-types/date) or [`DateTime`](/reference/data-types/datetime) or [`DateTime64`](/reference/data-types/datetime64)
* `weight` — Column with weights of sequence members. Weight is a number of value occurrences. [`UInt*`](/reference/data-types/int-uint)

**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*)`](/reference/data-types/array) or [`Array(Int128)`](/reference/data-types/array) or [`Array(UInt128)`](/reference/data-types/array) or [`Array(Int256)`](/reference/data-types/array) or [`Array(UInt256)`](/reference/data-types/array) or [`Array(Float*)`](/reference/data-types/array) or [`Array(Decimal*)`](/reference/data-types/array) or [`Array(Date)`](/reference/data-types/array) or [`Array(DateTime)`](/reference/data-types/array) or [`Array(DateTime64)`](/reference/data-types/array)

**Examples**

**Computing multiple exact weighted quantiles**

```sql title=Query theme={null}
SELECT quantilesExactWeighted(0.25, 0.5, 0.75)(number, 1) FROM numbers(10)
```

```response title=Response theme={null}
┌─quantilesExactWeighted(0.25, 0.5, 0.75)(number, 1)─┐
│ [2,4,7]                                            │
└────────────────────────────────────────────────────┘
```
