Hello,
I start with influxdb and I need your expertise!
I save every 15 minutes in a series the evolution of a meter (gas)
I wish to make a request to retrieve the evolution of this meter hour by hour.
So I group the measurements by 1 hour and I apply the SPREAD function. But if the meter does not evolve for an entire hour, it is not enough:
Example:
I get this result
select SPREAD(value) from indexgaz where time > now() - 4h group by time(1h) fill(0)
name: indexgaztime spread
1520020800000000000 0
1520024400000000000 0 → desired value : 0.07
1520028000000000000 0
1520031600000000000 0
1520035200000000000 0
with these data :
select MIN(value) from indexgaz where time > now() - 4h group by time(1h) fill(0)
name: indexgaz
time min
1520020800000000000 12908.71
1520024400000000000 12908.78
1520028000000000000 12908.78
1520031600000000000 12908.78
1520035200000000000 0
SELECT MAX(value) from indexgaz where time > now() - 4h GROUP BY time(1h) fill(0)
name: indexgaz
time max
1520020800000000000 12908.71
1520024400000000000 12908.78
1520028000000000000 12908.78
1520031600000000000 12908.78
1520035200000000000 0
select COUNT(value) from indexgaz where time > now() - 4h group by time(1h) fill(0)
name: indexgaz
time count
1520020800000000000 4
1520024400000000000 4
1520028000000000000 4
1520031600000000000 4
1520035200000000000 0
Thank you for your advice