to make influxdb more useable for queries and long time analysis I created a second database “longterm” incl. continuous queries and also included in these queries are aggregate functions like integral() to convert the data from W(att) to kWh.
CREATE CONTINUOUS QUERY “15mTrok” ON “longterm”
SELECT INTEGRAL(“value”) /3600000 AS value
GROUP BY time(15m),*
But these queries uses the time stamp from the beginning of the period (15m) and stores the result of the calculation in it. This examples only effects 15 Minutes but same procedure for longer periods (weeks, months) will bring up very bad results.
In case I have “raw”-data which is already stored in kwh (electrician counter) i can make use of min(“value”) function but for aggregate function like sum(“value”) the result will also be wrong.
Can you recommend how to solve?