---
schema_version: "1"
id: d1169c6f72ac4e35165875740e252f2efc3c5cc65107647db52d14be07d5f12e
title: Show the Top and Bottom Quartile
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-examples-topbotquartile.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-topbotquartile.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 60169e57b8900a5f0d493e053dfc21175aaf752049c5d8176f7ee3ee3a3a0568
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Show the Top and Bottom Quartile

Use SAQL to calculate percentiles, like the top and bottom quartile of your data.

## Example - Show Top Quartile and Bottom Quartile Deal Size by Country

Suppose that you want to see the top and bottom quartile deal size, by country. You want to see the size of the actual deal, not the interpolated (or 'average') deal size. Use `percentile_disc(.25)` and `percentile_disc(.75)`.

```nolang
q = load "Data";
q = group q by 'Billing_Country';
q = foreach q generate 'Billing_Country' as 'Billing_Country', percentile_disc(0.25) within group (order by 'Amount' desc) as '25th Percentile', percentile_disc(0.75) within group (order by 'Amount' desc) as '75th Percentile';
q = order q by '25th Percentile' asc;

```

Use a bar chart and select **Axis Mode** > **Single Axis** to show the top and bottom quartiles together.

![Diagram showing percentile continuous.](https://developer.salesforce.com/media/bi_dev_guide_saql/topandbottomquartile.png)

**See Also**

- [percentile_disc()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pd.md)
