# Average number of records over hour of day, day of week and month of year

**URL:** https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057
**Category:** Kibana
**Created:** [November 15, 2016, 6:09am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057 "2016-11-15T06:09:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![shantanuchalla](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@shantanuchalla](https://discuss.elastic.co/u/shantanuchalla)
#### Post date: [November 15, 2016, 6:09am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057/1 "2016-11-15T06:09:24Z")

</div>

I want to generate a visualization which shows average no. of records generated over different hours of the day across days or average no. of records on a monday or any day of the week. Similarly for average no. of records in a month over the years.  
i have been able to get the total count but not the average number of records.  
My data has timestamp, Type of Record, host and user id

I have tried manually loading data for each hour, day and month using a different index. But, then I couldn't apply filters to get a better understanding of the visualization.

is there any method where I can generate such graphs or is it there some way that I load data to achieve this?

---

<div class="post-metadata">

### Author: ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)
#### Post date: [November 15, 2016, 9:30am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057/2 "2016-11-15T09:30:30Z")

</div>

I am not sure i fully understand your question. Lets just go for the first use case you mentioned. You want to generate a bar chart for example, where each bar represents one hour of your data. so you want 24 bars (one for each hour of day) where the value is actually average count for that hour over a whole month of data for example ?  
so lets say that today at 10' there was 50 documents and yesterday at 10' there were 30 documents ... you would want to show value 40 there ?

---

<div class="post-metadata">

### Author: ![shantanuchalla](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@shantanuchalla](https://discuss.elastic.co/u/shantanuchalla)
#### Post date: [November 15, 2016, 10:18am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057/3 "2016-11-15T10:18:14Z")

</div>

@ppisljar  
Exactly the scenario!  
And it would be better if it could pick up the period of time from the time picker as other visualizations pick up

---

<div class="post-metadata">

### Author: ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)
#### Post date: [November 15, 2016, 10:27am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057/4 "2016-11-15T10:27:11Z")

</div>

I dont think this is currently possible but should be with [nested type aggregations](https://github.com/elastic/kibana/issues/1084)

---

<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: [December 13, 2016, 10:27am UTC](https://discuss.elastic.co/t/average-number-of-records-over-hour-of-day-day-of-week-and-month-of-year/66057/5 "2016-12-13T10:27:31Z")

</div>

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