> ## 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.

> Like quantilesBFloat16 but takes into account the weight of each value.

# quantilesBFloat16Weighted

<h2 id="quantilesBFloat16Weighted">
  quantilesBFloat16Weighted
</h2>

Introduced in: v21.10.0

Like [`quantilesBFloat16`](/reference/functions/aggregate-functions/quantilesBFloat16) but takes into account the weight of each value.

Computes multiple approximate [quantiles](https://en.wikipedia.org/wiki/Quantile) of a sample consisting of [bfloat16](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) numbers at different levels simultaneously, in a single pass.

**Syntax**

```sql theme={null}
quantilesBFloat16Weighted(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` or `DateTime`. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Date`](/reference/data-types/date) or [`DateTime`](/reference/data-types/datetime)
* `weight` — Column with weights of sequence members. Weight is a number of value occurrences. [`UInt*`](/reference/data-types/int-uint)

**Returned value**

Array of approximate quantiles of the specified levels in the same order as the levels were specified. For `Date` and `DateTime` inputs the output format matches the input format. [`Array(Float64)`](/reference/data-types/array) or [`Array(Date)`](/reference/data-types/array) or [`Array(DateTime)`](/reference/data-types/array)

**Examples**

**Computing multiple weighted bfloat16 quantiles**

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

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