Irregular time series to regular time series

Hi,
I would like to change my irregular time series to regular time series. Is there any way to do that in flux? . I would like to have time series with 1s granularity. Is there any possibility to do that in flux?
I attached a sample of my data after using window() function.

from(bucket: “bucket”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “measurement”)
|> filter(fn: (r) => r[“id”] == “123”)
|> filter(fn: (r) => r["_field"] == “field”)
|> window (every: 10s, createEmpty: true)

Any help is appreciated.
Regards
Aleksandra

I attached a sample of my data after using window() function.

Hello @Aleksandra_D,
Sorry for the delay. I’m not sure why that isn’t working. Are you not returning any rows with null values?
However, I recommend using:

  |> truncateTimeColumn(unit: 1s)

https://docs.influxdata.com/influxdb/cloud/query-data/flux/manipulate-timestamps/#normalize-irregular-timestamps