Scripted field with division does not show result

I think this should get you the ratio of your 2 metrics.

  1. Create a Sum aggregation for the sum of the first metric
  2. Create a Sum aggregation for the sum of the second metric
  3. Create a Calculation aggregation, create 2 variables to represent the 2 sums above, put the ratio of the 2 in the Painless Script field. Make sure to put params. before your variable names