I think this should get you the ratio of your 2 metrics.
- Create a Sum aggregation for the sum of the first metric
- Create a Sum aggregation for the sum of the second metric
- 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
