I am trying to use flux query language to find the sum of a column based on a person. If I have the following input table:
How can I use a Flux Query to obtain the following output table:
I have tried something like this so far but I get errors:
from: (bucket: "example")
|> range(start:v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r)=> r["_measurement"] == "test")
|> group(columns: r["person"])
|> reduce( fn: (r, accumulator) => ({sum: r._value + accumulator.sum}), identity: {sum: 0})