How to quickly query the daily electricity consumption of each day in a year based on time series data of cumulative data electricity meters? My current query method using Apache IoTDB is too complicated and I want to simplify it, but it seems that aggregation by day and the spread
function cannot be used, because the data I got from the electricity meter is a cumulative amount. The collection frequency is 5 minutes, and what I need is to subtract the value at 0 o’clock today from the value at 0 o’clock yesterday. See if anyone can provide easier query statement.
My current method in IoTDB is:
- Query the value at 0:00 yesterday, add fill(previous), and get the value A;
- Query the value at 0:00 yesterday, and add fill(previous) to get the value B;
- Calculate B-A, and repeat this process 365 times (to get a year data).