[Kibana] How to divide using the sum of two columns?

I want to construct a new column by dividing the sum of column A by the sum of column B as shown below.
'---------------------------------------------------------------------------------
| Date | Sum of Col A | Sum of Col B | Average |
'---------------------------------------------------------------------------------
| 20200620 | 1000 | 10 | 100 |
'---------------------------------------------------------------------------------
So, I added as below in JSON input of new column, but the correct value is not coming out.
Is it possible to configure as above with general visualization (data table) rather than Visual Builder?

{
 "script":
 "doc['ColumnA'].sum()/doc['ColumnB'].sum()"
 }

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