# Bucket Script Aggregating on fields that contain a period

**URL:** <https://discuss.elastic.co/t/bucket-script-aggregating-on-fields-that-contain-a-period/139428>\
**Category:** Elasticsearch\
**Created:** [July 10, 2018, 9:00pm UTC](https://discuss.elastic.co/t/bucket-script-aggregating-on-fields-that-contain-a-period/139428 "2018-07-10T21:00:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tadgh](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@tadgh](https://discuss.elastic.co/u/tadgh)\
**Post date:** [July 10, 2018, 9:00pm UTC](https://discuss.elastic.co/t/bucket-script-aggregating-on-fields-that-contain-a-period/139428/1 "2018-07-10T21:00:34Z")

</div>

I am performing a percentiles aggregate over data. I also want to perform a bucket\_script aggregation, based on the results of the percentiles (defining interquartile range). I am unable to query the percentile values, as I seem to be unable to query over fields that contain a period. Here is my query:

```
{
  "size": 0,
        "aggs": {
          "base_agg": {
            "terms": {"field": "action.keyword"},
            "aggs": {
              "score_outlier": {
                "percentiles": {
                  "field": "actionParameters.score_numeric"
                 }
              },
              "iqr": {
                "bucket_script": {
                  "buckets_path": {
                    "q1": "score_outlier.values.25.0",
                    "q3": "score_outlier.values.75.0"
                  },
                  "script": "params.q3 - params.q1"
                }
              }
            }
          }
        }
}

```

The results from the percentiles aggregate looks as expected:

```
 "score_outlier": {
         "values" : {
            "1.0": 5.0,
            "5.0": 25.0,
            "25.0": 165.0,
            "50.0": 445.0,
            "75.0": 725.0,
            "95.0": 945.0,
            "99.0": 985.0
         }
      }

```

I've tried escaping multiple ways, but no dice:  
`No aggregation found for path [score_outlier.values.25.0]`  
​

---

<div class="post-metadata">

**Author:** ![fredericogalvao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fredericogalvao/32/33093_2.png) [@fredericogalvao](https://discuss.elastic.co/u/fredericogalvao)\
**Post date:** [July 11, 2018, 12:33am UTC](https://discuss.elastic.co/t/bucket-script-aggregating-on-fields-that-contain-a-period/139428/2 "2018-07-11T00:33:35Z")

</div>

Make sure to read the docs on the `buckets_path` sintax, and see if that clarifies it for you:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html#buckets-path-syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html#buckets-path-syntax)  
(remember to change the version of the docs from `master` to the one you're using)

---

<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:** [August 8, 2018, 12:33am UTC](https://discuss.elastic.co/t/bucket-script-aggregating-on-fields-that-contain-a-period/139428/3 "2018-08-08T00:33:43Z")

</div>

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