# Kibana Data Table division between two column

**URL:** <https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882>\
**Category:** Kibana\
**Created:** [August 5, 2019, 8:14pm UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882 "2019-08-05T20:14:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simple\_commentateur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simple_commentateur/32/45428_2.png) [@simple\_commentateur](https://discuss.elastic.co/u/simple_commentateur)\
**Post date:** [August 5, 2019, 8:14pm UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882/1 "2019-08-05T20:14:34Z")

</div>

Hi,

My data table look like this :

 ![data_table](https://us1.discourse-cdn.com/elastic/original/3X/8/9/8938d47732f6497f49e7d350642fb962ae52105a.png)

and i want to add a column with the ratio sum(delivered)/sum(volume).

Is it possible?

I see in others topics that it could be done with canvas or Visual Builder math aggregation.

i didn't manage to do it with canvas and in Visual Builder i couldn't use math aggregation, it's locked:

 ![math](https://us1.discourse-cdn.com/elastic/original/3X/4/b/4b1b5b9deb11127ae47c973800947934b4a87af3.png)

thank you to point me to other potential solutions

EDIT : I managed to use math aggregation in visual builder but i can't divide, i can only add, subtract and multiply variable. I have the same issue with json input in data table.

I have another problem with visual builder, the time field and interval don't allow me to display my data as I want.

---

<div class="post-metadata">

**Author:** ![kumar8055](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kumar8055](https://discuss.elastic.co/u/kumar8055)\
**Post date:** [August 6, 2019, 5:26am UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882/2 "2019-08-06T05:26:37Z")

</div>

Hi @simple_commentateur,

You can achieve using scripted fields.

Try to create a scripting field under management--\>index pattern--\> scripting fields.

1. Name the field and data type
2. In the script section use  
{ doc['sum\_deleivered\_field].value/doc['sum\_volume\_field'].value}

use the scripted field in your table.

--Kumar

---

<div class="post-metadata">

**Author:** ![simple\_commentateur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simple_commentateur/32/45428_2.png) [@simple\_commentateur](https://discuss.elastic.co/u/simple_commentateur)\
**Post date:** [August 6, 2019, 7:32am UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882/3 "2019-08-06T07:32:22Z")

</div>

But I use sum aggregation in the data table and scripted field don't affect them.

An alternative is to use weighted average because I send the ratio that I need.

I can use average aggregation of this ratio if it depend of volume too

---

<div class="post-metadata">

**Author:** ![simple\_commentateur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simple_commentateur/32/45428_2.png) [@simple\_commentateur](https://discuss.elastic.co/u/simple_commentateur)\
**Post date:** [August 6, 2019, 11:54am UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882/4 "2019-08-06T11:54:04Z")

</div>

Any solutions?

---

<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 3, 2019, 11:54am UTC](https://discuss.elastic.co/t/kibana-data-table-division-between-two-column/193882/5 "2019-09-03T11:54:10Z")

</div>

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