Percentile aggregations

Percentile is the percentage of the data that’s at or below a certain threshold value.

The percentile metric is a multi-value metric aggregation that lets you find outliers in your data or figure out the distribution of your data.

Like the cardinality metric, the percentile metric is also approximate.

The following example calculates the percentile in relation to the taxful_total_price field:

  1. GET opensearch_dashboards_sample_data_ecommerce/_search
  2. {
  3. "size": 0,
  4. "aggs": {
  5. "percentile_taxful_total_price": {
  6. "percentiles": {
  7. "field": "taxful_total_price"
  8. }
  9. }
  10. }
  11. }

copy

Example response

  1. ...
  2. "aggregations" : {
  3. "percentile_taxful_total_price" : {
  4. "values" : {
  5. "1.0" : 21.984375,
  6. "5.0" : 27.984375,
  7. "25.0" : 44.96875,
  8. "50.0" : 64.22061688311689,
  9. "75.0" : 93.0,
  10. "95.0" : 156.0,
  11. "99.0" : 222.0
  12. }
  13. }
  14. }
  15. }