Kibana Data Table division between two column

Hi,

My data table look like this :

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:

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.

1 Like

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

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

Any solutions?

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