cheesus
cheesus

Reputation: 1181

Joining tables in Flux: empty response

I want to join two influxdb measurement's timeseries together and perform some calculations. However, not even joining them seems to work ... The result is just empty. The measurements have a "time" and a "value" column.

data_1 = from(bucket:"telegraf/autogen")
  |> range(start:-1h)
  |> filter(fn: (r) =>
    r._measurement == "measurement1" and
    r._field == "value")
  |> aggregateWindow(every: 1m, fn: mean)

data_2 = from(bucket:"telegraf/autogen")
  |> range(start:-1h)
  |> filter(fn: (r) =>
    r._measurement == "measurement2" and
    r._field == "value")
  |> aggregateWindow(every: 1m, fn: mean)
  

join(tables: {d1: data_1, d2: data_2}, on: ["time"])

What am I doing wrong?

Upvotes: 0

Views: 648

Answers (1)

Shay Moshe
Shay Moshe

Reputation: 482

You are using "time" instead of "_time"

Try:

join(tables: {d1: data_1, d2: data_2}, on: ["_time"], method: "inner")

Upvotes: 1

Related Questions