Hi,
I am have 2 different measurements with few columns that are same. This is default query for both measurements showing the same columns
from(bucket: "bucket1")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "measurement1" or r["_measurement"] == "measurement2")
|> filter(fn: (r) => r["_field"] == "field1" or r["_field"] == "field2")
|> filter(fn: (r) => r["tag1"] == "1")
|> aggregateWindow(every: 5m, fn: mean, createEmpty: false)
|> yield(name: "mean")
Resulting in
I am trying to aggregate and group data by column but I am not sure how to do that correctly because if I group by value all the columns get grouped into one. Here is what I am trying:
from(bucket: "bucket1")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "measurement1" or r["_measurement"] == "measurement2")
|> filter(fn: (r) => r["_field"] == "field1" or r["_field"] == "field2")
|> filter(fn: (r) => r["tag1"] == "1")
|> group(columns: ["_time"])
|> mean(column: "_value")
|> group()
|> aggregateWindow(every: 5m, fn: mean, createEmpty: false)
|> yield(name: "mean")
But what I get is then one graph instead of two
What I need is to group somehow by fields but I am failing to do so.