# Doubt about accomplishing aggregations in Kibana

**URL:** <https://discuss.elastic.co/t/doubt-about-accomplishing-aggregations-in-kibana/145829>\
**Category:** Kibana\
**Created:** [August 24, 2018, 3:44am UTC](https://discuss.elastic.co/t/doubt-about-accomplishing-aggregations-in-kibana/145829 "2018-08-24T03:44:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Utane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_utane/32/27547_2.png) [@Nikhil\_Utane](https://discuss.elastic.co/u/Nikhil_Utane)\
**Post date:** [August 24, 2018, 3:44am UTC](https://discuss.elastic.co/t/doubt-about-accomplishing-aggregations-in-kibana/145829/1 "2018-08-24T03:44:46Z")

</div>

Hi,

I am learning in depth about aggregations and going through the official doc.  
Just wanted to confirm my understanding that some of the examples given there cannot be accomplished using Kibana and are meant to be implemented by client applications.  
To give an example consider this query in [Range Aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html)  
I tried using the JSON input to specify stats sub-aggregation, but it merges with the range aggregation instead of as a sub-aggregation.

```auto
GET /_search
{
    "aggs" : {
        "price_ranges" : {
            "range" : {
                "field" : "price",
                "ranges" : [
                    { "to" : 100 },
                    { "from" : 100, "to" : 200 },
                    { "from" : 200 }
                ]
            },
            "aggs" : {
                "price_stats" : {
                    "stats" : { "field" : "price" }
                }
            }
        }
    }
}

```

So is my understanding correct that the above query cannot be drafted using Kibana (unless of course I have my custom visualization)?

-Thanks  
Nikhil

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 24, 2018, 10:26am UTC](https://discuss.elastic.co/t/doubt-about-accomplishing-aggregations-in-kibana/145829/2 "2018-08-24T10:26:00Z")

</div>

Hello,

You are indeed right, you would have to write your own visualization or add it as an aggregation to an existing Kibana visualization. There is an open enhancement request for it here:

> <https://github.com/elastic/kibana/issues/9841>

---

<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:** [September 21, 2018, 10:26am UTC](https://discuss.elastic.co/t/doubt-about-accomplishing-aggregations-in-kibana/145829/3 "2018-09-21T10:26:01Z")

</div>

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