Monthly average from 06:00. Might be simple but I´m getting lost. What to calculate the average from 06:00 the first day of each month to 06:00 the first day of next. Having trouble around midnight and getting strange values. Any smart ideas?

Parents Reply
  • I tried your formula and I don't get any spikes or inconsistencies around that. I'm using the example tag 'cdt158' and it appears to work for me. The only thing I could see is that the factor you're multiplying the TagAvg with, will become zero for the first day of every month, so when I ran a test with 6h calculation period, all the first four values were 0. But if you run this daily, this should work fine.

    If the factor is supposed to be the hours since the start of the calculation, you could get that more accurately by subtracting the two timestamps. Then you're left with a variable with the 'timespan' data type, which you could convert into seconds, then into hours. In this screenshot the two are the same, but it'll work more accurately for the entire month.


    image.png

Children
No Data