Hi,
How do i query :
SELECT spread(“Value”) FROM “471200_STEM_AHU01” WHERE (“Units” = ‘kWh’ AND “Name” = ‘AV_1002_STEM_AHU01_SF1_ELEC_CONS_KWH_AV’) AND time >= now() - 24h GROUP BY time(1h), “Name”
from influx 1.8 in v2. I can’t get the value to spread every 1h. Can’t figure out how to make the GROUP BY time(1h) function in v2.
So far, this is what i ended up with:
from(bucket: “048_STEM”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “471200_STEM_AHU01”)
|> filter(fn: (r) => r[“Units”] == “kWh”)
|> filter(fn: (r) => r[“Name”] == “AV_1002_STEM_AHU01_SF1_ELEC_CONS_KWH_AV”)
|> filter(fn: (r) => r["_field"] == “Value”)
|> spread()
Thx in advance!