On Saturday, October 15, 2016 at 5:07:19 PM UTC+10, Mathias Herberts wrote: > An approach with a time window does not work for computing time weighted > average as you may have windows with no chainges at all or a change after the > beginning of the window and in those two cases you will not have access to > the actual value of your sensor during the whole or part of the time window. > > > Your best option so far is probably to fill the data with the previous value > with a regularized series (regular ticks) and then compute the average on > this transformed series. The computed value for first and last window will be > incorrect but that can be mitigated by increasing your time range.
Hi Mathias, Yes, for the first datapoint calculation you have to check the previous datapoint just before the start of the time window (or use the same value as the first point in the time window as approximation if there is no previous value). If there is no changes in the time window then using the previous value outside the time window is your average. -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/6e6d8238-3fac-4253-af84-af9e456ed292%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
