# MV_PERCENTILE

The MV_PERCENTILE function converts a multivalued field into a single valued field containing the value at which a specified percentage of observed values occur.

## Syntax

`MV_PERCENTILE(number, percentile)`

### Parameters

#### number

Multivalue expression containing the values to analyze.

#### percentile

The percentile to calculate. Must be a number between 0 and 100. If the value is out of range, the function returns null.

## Examples

Calculates the 50th percentile (median) of an array of values and compares it to the result of the MV_MEDIAN function.

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