I have a series of points that denote the energy in joules I want to convert this to power so that energy used from 7:00 to 7:15 would be stored with a timestamp of 7:00. Using the DIFFERENCE
function calculates the difference relative to the last point. So energy used from 7:00 to 7:15 is stored as 7:15. I need it to be 7 not 7:15.
Could anyone give me some ideas how I can produce the data I want?
Example:
energy joules=101378708 1499410800000000000
energy joules=101379059 1499411700000000000
energy joules=101390839 1499412600000000000
energy joules=101408990 1499413500000000000
energy joules=101427152 1499414400000000000
SELECT DIFFERENCE(joules) / ELAPSED(joules, 1s) AS watts FROM energy
Gives me
time watts
---- -----
2017-07-07T07:15:00Z 0.39
2017-07-07T07:30:00Z 13.088888888888889
2017-07-07T07:45:00Z 20.16777777777778
2017-07-07T08:00:00Z 20.18
But I want
time watts
---- -----
2017-07-07T07:00:00Z 0.39
2017-07-07T07:15:00Z 13.088888888888889
2017-07-07T07:30:00Z 20.16777777777778
2017-07-07T08:45:00Z 20.18