hi,
i am using influx 2.0 oss and want to achieve the following:
aggregate data per month
this should be an easy task, but i only get data for completed months.
e.g. i have data from 2021-03-09 until today. with my query i only get data for march. what i want is to get data for the current month displayed as well. that doesn’t work. any hint?
my query:
rawSeries=from(bucket: "test")
|> range(start: -1y)
|> filter(fn: (r) => r["_measurement"] == "data")
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["type"] == "Export")
|> aggregateWindow(every: 1d, fn: first, timeSrc: "_start")
|> difference()
|> timeShift(duration: -2h1s)
namedSeries = rawSeries
|> map(fn: (r) => ({_value:r._value, _time:r._time,_type:r.type, _field:"erzeugte Leistung "+r.type}))
namedSeries |> yield()
but this gives me just one row:
result
table
_field
_time
_type
_value
0
erzeugte Leistung Export
2021-03-31T21:59:59Z
Export
1002.9200000000001
what am i doing wrong?