Backreferences/State in Flux

I am wondering how one references different rows to transform a timeseries with Flux. For example, I’d like to replace each datapoint with the lowest of the previous n datapoints, or potentially the std dev of the past n values.

Additionally, it would be nice to be able to pass curried functions into aggregateWindow… for example:
|> aggregateWindow(every: 10s, fn: lowestMin(n))

For anyone else who encounters this: the answer is to use window.