Combining data from two similar tables

@christiaan When you union two streams, it maintains the group keys, so the data is still partitioned into separate tables by series (common measurement, tag set, and field key).
To group everything into a single table, you can just use group() (with no parameters).

In your particular use case, you don’t even need to create two streams and union them together. You can just do:

from(bucket: "StationData")
  |> range(start: -3h)
  |> filter(fn: (r) =>
    r._measurement == "plc" and
    (r._field == "Pump1" or r._field == "Pump2") and
    r.host == "Station1"
  )
  |> group()
2 Likes