Merge Data from two tables to generate XY Scatterplot ...Help?

import “join”

X_Position=from(bucket: “C30_FlexFeeding”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “Program:C30_S10_ScaraLoadFlipNest.C30S10_ScaraFlexFeederData.F1_LastPick_X_Location”)
|> filter(fn: (r) => r[“_value”] > 0 ) // remove non measurements
|> map(fn: (r) => ({time: r._time, source: r._measurement, X_Position: r._value }),)
|> group(columns: [“_start”]) // Assign a common group key for the join operation below
//|> yield(name: “X_Position”)

Y_Position=from(bucket: “C30_FlexFeeding”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “Program:C30_S10_ScaraLoadFlipNest.C30S10_ScaraFlexFeederData.F1_LastPick_Y_Loaction”)
|> filter(fn: (r) => r[“_value”] > 0 ) // remove non measurements
|> map(fn: (r) => ({time: r._time, source: r._measurement, Y_Position: r._value }),)
|> group(columns: [“_start”]) // Assign a common group key for the join operation below
//|> yield(name: “Y_Position”)

|> join(tables: {key1: X_Position, key2: Y_Position}, on: [“_start”, “X_Position”, “Y_Position”], method: “full”)
|> group(columns: [“_start”])
|> yield(name:“XY_Position”)

This query doesn’t seem to like my import “join” or the key2: Y_position. I am using Influxdb version 2.4.0

Hello @ccolyer,
Welcome!
You can view the support for every function for flux in the docs.
Join is supported for 2.4 . Click the View InfluxDB Support button:

What’s the error that you’re getting please?
But also you’ll want to remove the |> before the join because you’re passing in variables into the function not streams.