# Parsing Exception during Percentile Calculation

**URL:** <https://discuss.elastic.co/t/parsing-exception-during-percentile-calculation/133775>\
**Category:** Elasticsearch\
**Created:** [May 30, 2018, 2:51am UTC](https://discuss.elastic.co/t/parsing-exception-during-percentile-calculation/133775 "2018-05-30T02:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Varun\_Somani](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@Varun\_Somani](https://discuss.elastic.co/u/Varun_Somani)\
**Post date:** [May 30, 2018, 2:51am UTC](https://discuss.elastic.co/t/parsing-exception-during-percentile-calculation/133775/1 "2018-05-30T02:51:53Z")

</div>

Seeing Parsing Exception when trying to calculate percentile across various fields, Any idea what can be done here?

Document:

```
{
  "county" : "Santa Clara",
  "city": "San Jose",
  "date" : 123432342342,
  "user" : {
    "0" : {
      "name" : "abc",
      "metrics" : {
        "m1" : 100.0,
        "m2" : 200.0
      }
    },
    "1" : {
      "name" : "abc1",
      "metrics" : {
        "m1" : 100.0,
        "m2" : 200.0
      }
    }
  }
}

```

Query Used:

```
"aggs" : {
    "percentile_agg" : {
        "percentiles" : {
            "field" : ["user.0.metric.m1", "user.1.metric.m1"],
            "percents": [
              50,
              90,
              99,
              99.9,
              100
            ],
          "hdr": { 
              "number_of_significant_value_digits" : 3
        }
        }
    }

```

Exception Seen:

```
{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[percentiles] field doesn't support values of type: START_ARRAY",
        "line": 17,
        "col": 27
      }
    ],
    "type": "parsing_exception",
    "reason": "[percentiles] field doesn't support values of type: START_ARRAY",
    "line": 17,
    "col": 27
  },
  "status": 400
}

```

Would it be easier if I make user as an array? Using Elasticsearch 6.2

---

<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:** [June 27, 2018, 2:55am UTC](https://discuss.elastic.co/t/parsing-exception-during-percentile-calculation/133775/2 "2018-06-27T02:55:49Z")

</div>

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