# Unable to show Hourly Average

**URL:** <https://discuss.elastic.co/t/unable-to-show-hourly-average/221773>\
**Category:** Kibana\
**Created:** [March 2, 2020, 9:18pm UTC](https://discuss.elastic.co/t/unable-to-show-hourly-average/221773 "2020-03-02T21:18:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [March 2, 2020, 9:18pm UTC](https://discuss.elastic.co/t/unable-to-show-hourly-average/221773/1 "2020-03-02T21:18:32Z")

</div>

hi All,

I am trying to show hourly average in a Kibana Visualization. I referred to the example in this link -[Hourly Average over 24 hours](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445/2).

However, when I select Histogram option, I get an error saying "The index pattern mypattern\* does not contain any of the following compatible field types: number". Do I need a custom script field to be added? I already have a timestamp field defined as date which I am using for time slicing.

I am using 7.5.2 of Kibana. Let me know if you need any further info.

Thanks!

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [March 5, 2020, 3:03pm UTC](https://discuss.elastic.co/t/unable-to-show-hourly-average/221773/2 "2020-03-05T15:03:11Z")

</div>

Yes, you need to create a scripted field containing the hour of the day for this.

Go to Management \> Index patterns \> _your index pattern_ \> scripted fields

and add a scripted field of type number like with this script:  
`doc['timestamp'].value.getHour()`

---

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [March 5, 2020, 7:00pm UTC](https://discuss.elastic.co/t/unable-to-show-hourly-average/221773/3 "2020-03-05T19:00:04Z")

</div>

thanks @flash1293. I am able to see it now. Looks like scripted fields are only available in Lens from 7.6 onwards. So will stick to regular histograms for now.

Thanks!

---

<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:** [April 2, 2020, 7:00pm UTC](https://discuss.elastic.co/t/unable-to-show-hourly-average/221773/4 "2020-04-02T19:00:10Z")

</div>

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