Sorry, I’m not sure why, but in my initial answer I assumed a
and b
were tags, not fields. You can use pivot()
to pivot a
and b
fields into the same rows:
from(bucket: "test/autogen")
|> range(start: MyStartTime, stop: MyEndTime)
|> filter(fn: (r) => r._measurement == "test" and r._field =~ /a|b/ )
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> filter(fn: (r) => r.a > 10 and r.b == 30)