Flux Query: Join by time and fill null-values with the last value

Good morning,
i need your help with a flux query.
I want to display several measurements in a uniform temporal sequence (every 10 seconds). However, not everyone has it at that time a value. In this case, I would like to have the last value that is the shortest back displayed. Is that possible?
Example:

Welcome @Cyrill.Sneer

Can you create a working Flux query that simply returns all the measurement values (null or otherwise) along with their timestamp? If yes, post the query here along with a snippet of the returned data. That will help others help you.

1 Like

Hello @grant1,
thank you very much for the welcome :slight_smile:
I haven’t defined the time series yet. I’m just joining the measures. Here is my query:

from(bucket: "openautogen")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop) 
  |> filter(fn: (r) =>
  r._measurement == "Growatt_PLocalLoadtotalH" or
  r._measurement == "Growatt_PpvH" or
  r._measurement == "Growatt_Pcharge1H" or
  r._measurement == "Growatt_Pdischarge1H" or
  r._measurement == "Growatt_PactogridtotalH" or
  r._measurement == "Growatt_PactouserTotalH"
  )

The result looks like this:

What happens if you add this?

|> group(columns: ["_time"])

and just maybe these 3 statements will give you the correct results?

    |> group(columns: ["_time"])
    |> last()
    |> group(columns: ["_value", "_time"], mode: "except")
2 Likes

It look great! Thank you for this solution.
Any other question. Can i make a CSV Export with this result?

'Fraid not…See post below.