from(bucket: "mydata")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == "wallets"
)
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> map(fn: (r) => ({r with _value: r.val_1 + r.val_2 }))
|> keep(columns: ["_time", "_value"])
|> truncateTimeColumn(unit: 1d)
Hey, I have this data that I get down to here |> truncateTimeColumn(unit: 1d)
and it is as I expect, a table of times truncated to just a date and a column of _value. From there, I tried to add
|> group(columns: ["_time"])
|> unique(column: "_value") // maybe just unique()
|> count()
but this is not working as expected and I am stuck where to go from here. My end goal is I want to get the _time and the _value that is most repeated within 1d timeframe. Would anyone have any idea where to go from here?