# percentile

relationalai.semantics.std.aggregates

```python
percentile(p: int | float, *args: AggValue) -> Aggregate
```

Compute the p-th percentile of values, interpolating linearly between
the two closest ranks (matches SQL's `PERCENTILE_CONT`).

## Parameters

- `p` (`int` | `float`) - The percentile to compute, in the range \[0, 100]. Must be a literal.
- `*args` (`AggValue`, default: `()`) - Values to compute the percentile over.

## Returns

- `Aggregate` - An `Aggregate` representing the computation of the percentile. Always returns `Float`.

## Examples

Compute the 90th percentile of order amounts:

```python
select(aggregates.percentile(90, Order.amount))
```

Compute the 90th percentile of salaries per department:

```python
select(Department, aggregates.percentile(90, Employee.salary).per(Department))
```

## Referenced By

1. [RelationalAI Documentation](/index.md)1) [What's new](/release-notes/index.md)1. [Python package and CLI release notes](/release-notes/python/index.md)1) [Python package and CLI 2.0.1](/release-notes/python/2.0.1/index.md)1. [Bug Fixes](/release-notes/python/2.0.1/index.md#bug-fixes)
