Flux: Empty Data-Windows


I have one measurement which contains tagged values for current an voltage. I want to calculate the value for power out of current and voltage. To achive this I joined the datasets for both values. The problem is that both values can have very different timestamps: e.g. current is at the same level for let´s say an hour. But voltage can change within seconds. There is a big rectifyer which should produce a constant current…

So I tried to put current and voltage in the same timewindows (10 seconds) . The problem is that if the e.g. the current is stable there will be many empty or missing timeslots. I tried for hours getting a solution.

from(bucket: "bde")
|> range(start: dashboardTime)
|> filter(fn: (r) => 
r._measurement == "aggrproto" and 
r._field == "aggrvalue" and 
r.aggrid == "Agg365GLR.IstwertI")
|> window(every: 10s)
|> mean()
|>fill(usePrevious: true)

Maybe you guys have an idea to get this working…

Hello @klinki,
Can you please share an annotated csv with your data so I can try and write the query? My first thought is that I think using union instead of join could help.

Hi Anaisdg,

Here is a bit of data. The first 28 lines contain the values for current. From 34-46 the values for voltage.

I´ve tried to get along with union but I am not happy yet. Still looking for an example…

2020-08-03-11-40 Chronograf Data.csv.gz (561 Bytes)