gjemp
November 23, 2021, 10:58am
1
Hei, how to make it to show also data that was added today first time. At the moment it will start showing diffrences on next day compared to todays last value.
from(bucket: "something")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "diagnostics" and r._field == "diagnostics_odometer_data_value" )
|> aggregateWindow(every: 1h, fn: last, createEmpty: false)
|> difference(nonNegative: false, columns: ["_value"], keepFirst: false)
|> group(columns: ["property"])
|> sort(columns: ["_time"], desc: true)
Anaisdg
December 13, 2021, 9:06pm
2
Hello @gjemp ,
Have you tried using the today() funciton?
You might need to use the timeShift() function
This thread might also be useful to you:
Hi,
we have an issue that aggregateWindow for month doesn’t work correctly with negative offset.
For zero offset it works fine, and for the following query
`
from(bucket: “my_bucket”) |> range(start: 2021-01-24T14:10:31+02:00, stop: 2021-12-24T14:10:31+02:00) |> filter(fn: (r) => r._measurement == “my_measurement”) |> filter(fn: (r) => r.machine == “123”) |> filter(fn: (r) => r._field == “span”) |> filter(fn: (r) => r.state == “working”) |> aggregateWindow(every: 1mo, offset: 0s, fn: sum, c…