You could compute delta= v.timerangestart - v timerangestop in a variable at the beginning. Note that, one of the 2, at least in the past, was a duration, so you have to convert it to a time (or an integer?) I don’t remember if it was start or stop but you’ll figure it out.
Then you make a sequence of if-else. Something like:
Test = if delta <1h then… Else if delta < 3h then…
I don’t remember exactly the if structure and i am on the phone. Anyway, we do something similar somewhere so it is doable
Then you replace your 10m in your script inside of the aggregate window with the variable Test
Good luck
Hi, MzazM,
Thank you for your advice!
I could set variable time in every.
I share the solution.
Every is 1m when range is less than 1h.
When range is over 1h, every is 10m.
but i not sure where the best position for the aggregateWindow() function is? is it the right after range or better after the filters? depends where you can leave behind the most datapoints, right? if you have datapoints every few seconds and a time range of a few days it is best to get rid of them as early as possible, right?