# Question about percentile rank query

**URL:** <https://discuss.elastic.co/t/question-about-percentile-rank-query/198323>\
**Category:** Elasticsearch\
**Created:** [September 5, 2019, 11:02pm UTC](https://discuss.elastic.co/t/question-about-percentile-rank-query/198323 "2019-09-05T23:02:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nee\_Defeng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nee_defeng/32/45771_2.png) [@Nee\_Defeng](https://discuss.elastic.co/u/Nee_Defeng)\
**Post date:** [September 5, 2019, 11:02pm UTC](https://discuss.elastic.co/t/question-about-percentile-rank-query/198323/1 "2019-09-05T23:02:06Z")

</div>

I had this query, with which I would expect to have value '0.000005' below the value returned from the record

```
              "system" : {
                "pct" : 0.016}

```

The question is: why it still shows the percentile as 100.0?

```
GET /metricbeat-7.3.1/_search
{
  "aggs": {
    "test_percentile": {
      "percentile_ranks": {
        "field": "system.cpu.system.pct",
        "values": [
          1,
          0.5,
          0.000005
        ]
      }
    }
  }, 
  "query": {
    "bool": {
      "filter": {
        "match": {"_id": "cKdA9mwBa9ZjV3C_Jg5w"}
      }
    }
  }
}

```

And the response was:

```
{
  "took" : 432,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 0.0,
    "hits" : [
      {
        "_index" : "metricbeat-7.3.1",
        "_type" : "_doc",
        "_id" : "cKdA9mwBa9ZjV3C_Jg5w",
        "_score" : 0.0,
        "_source" : {
          "@timestamp" : "2019-09-03T08:31:34.025Z",
          "ecs" : {
            "version" : "1.0.1"
          },

```

......  
"id" : "a43e1577a5804785a131ba4d1ef34ea3",  
"containerized" : false  
},  
"agent" : {  
"id" : "cb4997de-b548-4ea4-9a48-9ab8fbb9dabe",  
"version" : "7.3.1",  
"type" : "metricbeat",  
"ephemeral\_id" : "5cbbd81b-0b97-41ac-9adb-8062b73459e4",  
...... },  
"event" : {  
"module" : "system",  
"duration" : 262779,  
"dataset" : "system.cpu"  
},  
"metricset" : {  
"name" : "cpu"  
},  
"service" : {  
"type" : "system"  
},  
"system" : {  
"cpu" : {  
"softirq" : {  
"pct" : 0.001  
},  
"system" : {  
"pct" : 0.016  
},  
"cores" : 8,  
"nice" : {  
"pct" : 0  
},  
"total" : {  
"pct" : 0.032  
},  
"iowait" : {  
"pct" : 0  
},  
"irq" : {  
"pct" : 0  
},  
"user" : {  
"pct" : 0.015  
},  
"idle" : {  
"pct" : 7.968  
},  
"steal" : {  
"pct" : 0  
}  
}  
}  
}  
}  
]  
},  
"aggregations" : {  
"test\_percentile" : {  
"values" : {  
"5.0E-6" : 100.0,  
"0.5" : 100.0,  
"1.0" : 100.0  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 3, 2019, 11:02pm UTC](https://discuss.elastic.co/t/question-about-percentile-rank-query/198323/2 "2019-10-03T23:02:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
