I'm continuously streaming the difference between two sensor values. I'd like to display the sum of those differences across a shift live while also logging the number at the end of the shift as well.
I've looked into tumbling windows but it seems I can't specify an actual time for those. I can specify the amount of time but not an actual time to start the window. If I could specify a time I could at least capture the historical values across shifts.
For the live data, I'd need to sum the data from start of tumbling window to the current data point, which to my knowledge is also not an option. Only the final aggregate is output after the window has ended.
I also took a look at using LAG() for this but that also does not allow specifying a timestamp and it would only allow comparing two values, not aggregate values.
Based on the documentation these are the two functions that are closest to having the functionality I need but neither accomplish the job.
Is there any way to aggregate all values from a certain start time to a current time (keep in mind the start time changes at the beginning of each shift)?