Calculate difference between two measurements

Hi,
i would to graph the difference between A and B series in Grafana.

It’s possible?

This is my current chart:
https://snapshot.raintank.io/dashboard/snapshot/ZYNc6iJx7uwuX4nRSMwPbnQnjPYhJsps

I don’t know about other data sources, but if you are using influx you can use the query
`SELECT mean(“A”)-mean(“B”) FROM “whatever” WHERE $timeFilter GROUP BY time($interval) fill(none)

Use influx.The problem is that the difference should be made between two different measures.

image

How should the FROM be used?

Thanks

I don’t think it is possible across measurements. You would have to put both variables in the same measurement.

I haven’t tried this myself, but in theory it’s possible these days with Flux; see https://www.influxdata.com/blog/influxdb-how-to-do-joins-math-across-measurements/
(Flux querying is available via a Grafana plugin)

Hi,
I’m facing a similar issue, i need to compare 2 times, of different versions, say R1 and R2, and plot the percentage difference in a 3rd column. How can it be done?
Thanks!

1 Like

After selecting measurmenets A and B, switch panel from Query to Transform. If none were selected find and select “Field From Calculation”. You’ll see your measurements, you can select Calculation: Difference to plot A-B