# How to visulize two level of aggregation in kibana?

**URL:** <https://discuss.elastic.co/t/how-to-visulize-two-level-of-aggregation-in-kibana/191467>\
**Category:** Kibana\
**Created:** [July 20, 2019, 6:06am UTC](https://discuss.elastic.co/t/how-to-visulize-two-level-of-aggregation-in-kibana/191467 "2019-07-20T06:06:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_google\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_google_user/32/46709_2.png) [@A\_google\_user](https://discuss.elastic.co/u/A_google_user)\
**Post date:** [July 20, 2019, 6:06am UTC](https://discuss.elastic.co/t/how-to-visulize-two-level-of-aggregation-in-kibana/191467/1 "2019-07-20T06:06:46Z")

</div>

I have a document type in Elasticsearch.  
doc1  
{  
event\_timestamp="2019-06-05 13:56:45"  
event\_type="heart\_beat"  
store\_id="abc"  
}  
I want to aggregate on two levels first on hours and then on days. Is it possible to do in Kibana? I want to (count number of hours in a day) =A in which at least one "heartbeat" event has come. then I want to find cumulative sum of A for a range of days. and divide that sum by 24\*(number of days in range).  
for particular store\_id

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [July 29, 2019, 8:21pm UTC](https://discuss.elastic.co/t/how-to-visulize-two-level-of-aggregation-in-kibana/191467/2 "2019-07-29T20:21:30Z")

</div>

What have you tried so far? I'm trying to figure out if a Pipeline aggregation over a Sum Bucket might work? Maybe Moving Average?

 ![Screenshot_2019-07-29%20Kibana(2)](https://us1.discourse-cdn.com/elastic/original/3X/1/7/179477d9aae445571ec2d4fa5ac63145f26ab7b9.png)

---

<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 26, 2019, 8:21pm UTC](https://discuss.elastic.co/t/how-to-visulize-two-level-of-aggregation-in-kibana/191467/3 "2019-08-26T20:21:30Z")

</div>

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