I am using influxDB2. I have a flux query that works fine to join two tables.
join( tables: {d1: data_3, d2: data_4}, on: [“agent_host”] )
However, when I add a table name to the statement to be able to use the combined query in a future join,
data_34 = join( tables: {d1: data_3, d2: data_4}, on: [“agent_host”] )
I get an error in the next join I attempt to do:
|> join( tables: {d1: data_12, d2: data_34}, on: [“agent_host”, “rttQosProbeDestName”] )
I get an error:
error @69:36-69:43: undefined identifier data_34
When the predictive text pops up as I am typing the name “data_34” it doesn’t even list data_34 as an option. I have done joins before and never had this issue.
Any ideas?
Hello @madonna,
Can I please see your full query?
Thank you.
The following works for me:
import "array"
one = array.from(rows: [{foo: "bar", baz: 21.2}, {foo: "bar", baz: 23.8}])
two = array.from(rows: [{foo: "bar", baz: 21.2}, {foo: "bar", baz: 23.8}])
three = array.from(rows: [{foo: "bar", baz: 21.2}, {foo: "bar", baz: 23.8}])
one_two = join(tables: {one: one, two: two}, on: ["foo"])
join(tables: {one_two: one_two, three: three}, on: ["foo"])
Hi @Anaisdg ,
Here is my query:
Target_Ip = “1.2.3.4”
from(bucket: “bucket_test”)
range(start: v.timeRangeStart, stop: v.timeRangeStop)
filter(fn: (r) => r[“agent_host”] == Target_Ip)
filter(fn: (r) => r[“_field”] == “metric1” )
filter(fn: (r) => r.destination == “dest1”)
last(column: “_value” )
pivot(rowKey:[“_time”], columnKey: [“_field”], valueColumn: “_value”)
map(fn: (r) => ({ r with “Result”: r.metric1 }))
keep(columns: [ “destination”, “Result”])
@Anaisdg - I’m so sorry. I didn’t look at the original post. Ignore my above post.
I resolved my problem. It was a syntax error.