﻿---
title: ES|QL PERCENTILE_OVER_TIME function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2970/reference/query-languages/esql/functions-operators/time-series-aggregation-functions/percentile_over_time
products:
  - Elasticsearch
---

# ES|QL PERCENTILE_OVER_TIME function
<applies-to>
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview since 9.3
</applies-to>


## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2970/reference/query-languages/esql/images/functions/percentile_over_time.svg)


## Parameters

<definitions>
  <definition term="field">
    the metric field to calculate the value for
  </definition>
  <definition term="percentile">
    the percentile value to compute (between 0 and 100)
  </definition>
</definitions>


## Description

Calculates the percentile over time of a field.

## Supported types


| field                                                                           | percentile | result |
|---------------------------------------------------------------------------------|------------|--------|
| double                                                                          | double     | double |
| double                                                                          | integer    | double |
| double                                                                          | long       | double |
| exponential_histogram <applies-to>Elastic Stack: Preview since 9.3</applies-to> | double     | double |
| exponential_histogram <applies-to>Elastic Stack: Preview since 9.3</applies-to> | integer    | double |
| exponential_histogram <applies-to>Elastic Stack: Preview since 9.3</applies-to> | long       | double |
| integer                                                                         | double     | double |
| integer                                                                         | integer    | double |
| integer                                                                         | long       | double |
| long                                                                            | double     | double |
| long                                                                            | integer    | double |
| long                                                                            | long       | double |
| tdigest <applies-to>Elastic Stack: Preview since 9.3</applies-to>               | double     | double |
| tdigest <applies-to>Elastic Stack: Preview since 9.3</applies-to>               | integer    | double |
| tdigest <applies-to>Elastic Stack: Preview since 9.3</applies-to>               | long       | double |


## Example

```esql
TS k8s
| STATS p95_cost=MAX(PERCENTILE_OVER_TIME(network.cost, 95)), p99_cost=MAX(PERCENTILE_OVER_TIME(network.cost, 99)) BY cluster, time_bucket = TBUCKET(1minute)
```