Window and fill with usePrevious value

Is there a way to use window method like aggregateWindow to fill data with previous value.

input
_time,SensorId,_measurement,_value
2022-03-10T01:21:32.749972517Z,5FA6,TestSensor,1
2022-03-10T01:24:14.051705026Z,5FA6,TestSensor,2
2022-03-10T01:30:54.375700332Z,5FA6,TestSensor,3
2022-03-10T02:22:32.749972517Z,5FA6,TestSensor,4
2022-03-10T04:24:14.051705026Z,5FA6,TestSensor,5
2022-03-10T07:30:54.375700332Z,5FA6,TestSensor,6
2022-03-10T08:21:32.749972517Z,5FA6,TestSensor,7

expect output
_time,SensorId,_measurement,_value
2022-03-10T01:21:32.749972517Z,5FA6,TestSensor,1
2022-03-10T01:24:14.051705026Z,5FA6,TestSensor,2
2022-03-10T01:30:54.375700332Z,5FA6,TestSensor,3
2022-03-10T02:22:32.749972517Z,5FA6,TestSensor,4
2022-03-10T03:00:00.000000000Z,5FA6,TestSensor,4
2022-03-10T04:24:14.051705026Z,5FA6,TestSensor,5
2022-03-10T05:00:00.000000000Z,5FA6,TestSensor,5
2022-03-10T06:00:00.000000000Z,5FA6,TestSensor,5
2022-03-10T07:30:54.375700332Z,5FA6,TestSensor,6
2022-03-10T08:21:32.749972517Z,5FA6,TestSensor,7

Hello @Erikson,
You can select create empty true when aggregating or using window.
Then use fill() function | Flux 0.x Documentation with previous

Hi @Anaisdg ,
We use |> window(every:1h, createEmpty: true), but we don’t get the empty to fill with previous next.
Version : InfluxDB OSS 2.0.7

_time,SensorId,_measurement,_value
2022-03-10T01:21:32.749972517Z,5FA6,TestSensor,1
2022-03-10T01:24:14.051705026Z,5FA6,TestSensor,2
2022-03-10T01:30:54.375700332Z,5FA6,TestSensor,3

2022-03-10T02:22:32.749972517Z,5FA6,TestSensor,4

2022-03-10T04:24:14.051705026Z,5FA6,TestSensor,5

2022-03-10T07:30:54.375700332Z,5FA6,TestSensor,6

2022-03-10T08:21:32.749972517Z,5FA6,TestSensor,7

It seems aggregateWindow with fn ability to create empty table and null record. So we can fill next.
But window function with createEmpty true doesn’t.

Because of sensor power saving strategy, we only get data changed with a threshold. When visualized in UI, we want to keep the original time and fill with previous value more real in curve not straight line.