Hello @loeten,
I think this would be easier with Flux…but let’s dust off some InfluxQL.
SELECT "T" - "W" FROM (SELECT mean(“Temperatur”) AS "T", mean("Wetness") AS "W" FROM “M41” WHERE (“Sensor” = ‘Beet’) AND AND time >= 'start' AND time <= 'end' GROUP BY time(10m) fill(previous))
I’m using this as a reference:
And I’m grouping by time and applying the mean to get the timestamps to line up. You could use whatever aggregation function you want though.