Fill every minute with previous value

Hey i have a time series which returns a value every 15-60 minutes.
Now i want to fill every Minute in between a value and the subsequent value with the previous value.
After calling my data i tried to achive this with the aggregateWindow() function or with the fill() function. Both options didn’t work.

My time series looks like this:

What i want to achive is something similiar to this:

The query i used was the following:
from(bucket: “myBucket”)

|> range(start: 2021-01-01T00:00:00Z)

|> filter(fn: (r) =>

r._measurement == “myMeasurement” and

r.short == “Status”

)

aggregateWindow(

every: 1m,

fn: (column, tables=<-) => tables |>fill(column: “_value”, usePrevious: true),

column: “_value”,

createEmpty: false

)

Could you please help me?

Hello @Patse,
That’s strange, I would expect that to work. I’m not sure what’s going on. Let me ask the Flux team.

I don’t know if it helps, but i get the following error when i try to run the query:
image

So something isn’t right with this part of my query

Hello @Patse,
Ah okay you’re going to have to use

|> aggregateWindow(..., fn: (column, tables=<-) => tables |> table.fill())
|> fill(usePrevious: true)

Lmk if that does the trick!

Hey, the fill funkctions like this was the answer. Thank you for your help

1 Like