Dose cumulative_sum support “sum of cumulations each day”?
there is our raw series data:
select value from new_add_numbers
time value
---- -----
2018-11-11T03:43:35Z 100
2018-11-11T21:09:32Z 100
2018-11-12T02:05:14Z 100
2018-11-12T06:01:47Z 100
Then select cumulative_sum(value) from new_add_numbers
result as:
time cumulative_sum
---- --------------
2018-11-11T03:43:35Z 100
2018-11-11T21:09:32Z 200
2018-11-12T02:05:14Z 300
2018-11-12T06:01:47Z 400
How can I get cumulative sum of each day?
like:
select cumulative_sum(value, 1d) from new_add_numbers
time cumulative_sum
---- --------------
2018-11-11T03:43:35Z 100
2018-11-11T21:09:32Z 200
2018-11-12T02:05:14Z 100 // sum reset to be zero on a new day
2018-11-12T06:01:47Z 200
Thanks