influxDB sumSince - sumTill?

is there anything which can do something like sumSince, but in specific interval?

sumSince is great for counting this year for example, but how to make it work just for lastyear?

eg. for this Year summary i’m doing this


if I want to have last year, for now I need to store the data in some kind of dummy Item/persistence like Item_2021

is there anything like sum for time intervals?

sumSince(now.minusYears(2)) - sumSince(now.minusYears(1)

No, but you can get the intervals you need by subtracting the sum from the end of the period you care about from the sum at the start of the period you care about.

Ah, thats clever and I haven’t been thinking like that :slight_smile:
Thank you!