Hi all, i need to create a task to run every midnight that downsample the data of previos day in one line. I need to keep al column downsampled because my table have multiple column that i use to filter the results.
import "influxdata/influxdb/schema"
option task = {name: "Downsample Kita PT", every: 1d, offset: 0m}
from(bucket: "kitalog")
|> range(start: -task.every)
|> filter(fn: (r) => r["_measurement"] == "KitaPT")
|> schema.fieldsAsCols()
|> filter(fn: (r) => r["pdc_pt_prod_acs"] == 1 and r["pdc_pt_defrosting"] == 0)
|> aggregateWindow(every: 10s, fn: mean, createEmpty: false, column: "pdc_pt_in_w",...."other columns")
|> aggregateWindow(every: task.every, fn: mean, createEmpty: false, column: "pdc_pt_in_w",...."other columns")
|> to(bucket: "KitalogDaily", org: "xxxxxx")
How can correct the query to obtain the result?
Thank!!