# MV_PERCENTILE

Converts a multivalued field into a single-valued field containing the value at which a certain percentage of observed values occur.

## Syntax

`MV_PERCENTILE(number, percentile)`

### Parameters

#### `number`

A multivalue expression.

#### `percentile`

The percentile to calculate. Must be a number between 0 and 100. Numbers outside this range will return `null`.

## Examples

```esql
ROW values = [5, 5, 10, 12, 5000]
| EVAL p50 = MV_PERCENTILE(values, 50), median = MV_MEDIAN(values)
```

This example calculates the 50th percentile (median) of the multivalued field `values` and compares it to the result of the `MV_MEDIAN` function.