Dear Influx experts,
I want to show my power summation in Grafana dashboard (Stat Panel). However, I am having trouble with my query configuration.
The data is something like this.
Timestamp, Power
10:00 am. 0
10:01 am 25
10:02 am. 20
10:03 am. 50
10:04 am. 53
10:05 am. 54
If I get the summation using the built-in summation aggregation,
It really adds the whole thing
0+25+20+50+53+54
However, this is not the kind of summation I want. What I want is to get the difference between the current and previous value and then it sum it up.
In my example above, the summation should be.
0 + 25 + 5 (difference between 25-20) + 30 (difference between 20-50) + 3 (difference between 53-50) + 1 ( difference between 54-53)
The summation should be = 64.
Kindly help me how am I going to achieve this.
Thank you very much.