Sum of absolute values does not work

Hello, i have a project about a water level visualization.
you can see the graph below. Now I want to calculate the volume of water going in and out per hour/day.
The plan was to
get the difference of each value with the value before (how much hight was added)
absolut value of those differences
integral of this area beneath the “graph”
sum up by hour/day/…
1st and 2nd i got working but it seems like sum & abs are not working together, because i get basically 0 as result, so it must be NOT taking the abs.values but the +/- values.
Hope someone can help?
SELECT SUM(“diffe”) AS sum FROM
SELECT abs(difference(mean(“value”))) AS diffe FROM “Schacht_Distanz” WHERE $timeFilter GROUP BY time(1m) fill(null)
GROUP BY time(1h)


Hello @Surfer2010,
Can you export some of your data and share it? Otherwise if you’re confident that this is a bug can you please file an issue?

I will try to send a csv with data on this replay (hope it works).
The Problem I have is … how to calculate the “volume” and more important the speed.

Volume should be very constant, but the “filling speed” will differ depending on weather and so on.

So I am interested in the speed the water level rises.Waterlevel-Data

Would be great to get help on this, I use Influxdb 2.0

Any new ideas or help? Would be really great