Value difference calculation for more than one measurement

Hello,

I want to calculate the difference of two values in a query for a some days

SELECT difference(last(value)) FROM “MyMeasurement1”
WHERE time >= now() - 5d
GROUP BY time(1d)

then I get the values I want to see for “MyMeasurement1”. This works…

My question is now: How can I calculate the same for ten different measurements of my database? Is it possible to get the difference of the last 10 days for more than one measurement (“MyMeasurement1”, “MyMeasurement2”, “MyMeasurement3”… ) or do I have to do it ten times for each measurement?

At the moment I use grafana 10.4.1 on a raspberry pi.

Thank you!
Regards

Thomas

If you are using InfluxQL, see this:

Currently, there is no way to perform cross-measurement math or grouping. All data must be under a single measurement to query it together. InfluxDB is not a relational database and mapping data across measurements is not currently a recommended schema. See GitHub Issue #3552 for a discussion of implementing JOIN in InfluxDB.