---
schema_version: "1"
id: a31117f80f6cec5e453f7d74beae3a77c21ae040c5bfffd8e60aab54bd43f012
title: percentile_cont()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/concept/bi-saql-fn-agg-pc.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pc.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 10869db288e9171786ac33633ca6ff4b5938b511399399090563d7da953ebb3f
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# percentile_cont()

Calculates a percentile based on a continuous distribution of the column value.

```nolang
percentile_cont(p) within group (order by expr [asc | desc])
```

`percentile_cont()` accepts a numeric grouped expression _expr_ and sorts it in the specified order. If order is not specified, the default order is ascending. It returns the value behind which (100\*_p_)% of values in the group fall in the sorted order, ignoring null values.

_p_ can be any real numeric value between 0 and 1. _expr_ can be any identifier, such as 'xInt' or 'price', but cannot be a complex expression, such as price/100 or ceil(distance), or a literal, such as 2.5.

If _expr_ contains no value that falls exactly at the 100\*p-th percentile mark, `percentile_cont()` returns a value interpolated from the two closest values in _expr_.

For example, if `Mea1` contains the values `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]` then:

```nolang
percentile_cont(0.25) within group (order by Mea1 asc) = 3.25
percentile_cont(0.25) within group (order by Mea1 desc) = 9.75
percentile_cont(0) within group (order by Mea1 asc) = 0
percentile_cont(1) within group (order by Mea1 asc) = 13

```

## Example - Display the Interpolated Value of the Bottom 15% of Deals

Suppose that you want to see the bottom 15% of deals for each rep. You don't need to see the actual deal size - just the 'average' size of the bottom 15%. Use `percentile_cont(.15)`.

![Diagram showing percentile continuous.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_perc.png)

**See Also**

- [percentile_disc()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pd.md)
