# QUANTILE

### Description

Calculates the quantile value on a set of numbers or event values, based on specified quantile.

Remark: to obtain the median value on an array, you can use the `QUANTILE` function with parameter `0.5` (i. e. the 50% quantile).

### QUANTILE(Vector\<Number/Event>, Scalar\<Number>)

```java
QUANTILE(vector: Vector<Number/Event>, Scalar<Number>): Scalar<Number>
```

#### Parameters

<table><thead><tr><th width="172">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>vector</td><td>A vector of type &#x3C;Number/Event></td></tr><tr><td>quantile</td><td>Quantile of type &#x3C;Number>, with value range [0, 1]</td></tr></tbody></table>

#### Returns

Returns the quantile value as Scalar\<Number>

***

### QUANTILE(GroupedScalar\<any, Number/Event>, Scalar\<Number>)

```java
QUANTILE(group: GroupedScalar<any, Number/Event>): Scalar<Number>
```

#### Parameters

<table><thead><tr><th width="172">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>group</td><td>A GroupedScalar of type &#x3C;any, Number/Event></td></tr><tr><td>quantile</td><td>Quantile of type &#x3C;Number>, with value range [0, 1]</td></tr></tbody></table>

#### Returns

Returns the quantile value as Scalar\<Number>

***

### QUANTILE(GroupedVector\<any, Number/Event>, Scalar\<Number>)

```java
QUANTILE(group: GroupedVector<any, Number/Event>): GroupedScalar<Number>
```

#### Parameters

<table><thead><tr><th width="219">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>group</td><td>A GroupedVector of type &#x3C;any, Number/Event></td></tr><tr><td>quantile</td><td>Quantile of type &#x3C;Number>, with value range [0, 1]</td></tr></tbody></table>

#### Returns

Returns the quantile value as GroupedScalar\<any, Number>

***

### Examples

Retrieve the 50% percentile of the GridPowerConsumption time series.

```java
QUANTILE($GridPowerConsumption, 0.5)
```
