# Kibnan visualize datatable calculate the average value

**URL:** <https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413>\
**Category:** Kibana\
**Created:** [January 21, 2018, 11:56pm UTC](https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413 "2018-01-21T23:56:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsiuming](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hsiuming](https://discuss.elastic.co/u/hsiuming)\
**Post date:** [January 21, 2018, 11:56pm UTC](https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413/1 "2018-01-21T23:56:40Z")

</div>

Hello

We now have a data table in kibana:

 ![未命名](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e5d9d2d3eba2e97edc836906360c5f8ac64f66ac.png)

We want to add one column to calculate the average value of the column2 within a specific time frame.

For example ,we want to calculate the average value between every second.

The export is :

 ![未命名2](https://us1.discourse-cdn.com/elastic/original/3X/1/c/1c8d17006cbdf0d5e87d272c27f03b77fa8b49c3.png)

Is there any method to do this?

---

<div class="post-metadata">

**Author:** ![ericohtake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericohtake/32/24539_2.png) [@ericohtake](https://discuss.elastic.co/u/ericohtake)\
**Post date:** [January 22, 2018, 1:27am UTC](https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413/2 "2018-01-22T01:27:42Z")

</div>

I think probably you can accomplish that with scripted field. I didn't try it yet, but it can give some ideas on how to accomplish this.

[https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

---

<div class="post-metadata">

**Author:** ![hsiuming](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hsiuming](https://discuss.elastic.co/u/hsiuming)\
**Post date:** [January 24, 2018, 12:02am UTC](https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413/3 "2018-01-24T00:02:13Z")

</div>

I think Scripted fields can't do it.

'doc['field\_name'].value' can't get other value on the same column.

Thanks for your reply.

Is there any other method?

---

<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:** [February 21, 2018, 12:02am UTC](https://discuss.elastic.co/t/kibnan-visualize-datatable-calculate-the-average-value/116413/4 "2018-02-21T00:02:38Z")

</div>

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