Using join.left() as lookup table

Hello @DavidHy,
The first thing I noticed is that your csv seems to be off. there’s a number of fields mismatch.
I simplified the csv and it worked. It looks like you were calling the column names a little off. I also changed the values of the dtcDesc so that you’d actually have values to join on.

import "csv"
import "join"

csvData1 = "_time,_value,_field,_measurement,dtc
2022-12-20T08:41:45Z,23,LHFC_DTC1,TEST01,23
2022-12-20T08:41:46Z,21,LHFC_DTC1,TEST01,21
2022-12-20T08:41:47Z,20,LHFC_DTC1,TEST01,20
2022-12-20T08:41:48Z,14,LHFC_DTC1,TEST01,14
2022-12-20T08:41:49Z,13,LHFC_DTC1,TEST01,13
2022-12-20T08:41:50Z,11,LHFC_DTC1,TEST01,11
2022-12-20T08:41:51Z,17,LHFC_DTC1,TEST01,17"

csvData2 = "_time,_value,_field,_measurement,dtc
2022-12-19T15:34:46Z,No DTC,descr,FC_DTC,0
2022-12-19T15:34:46Z,Air Flow Below Setp Run ,descr,FC_DTC,12
2022-12-19T15:34:46Z,Air Flow Below Setp Run,descr,FC_DTC,17"
orgDtc = csv.from(csv: csvData1, mode: "raw")
// |> yield(name: "orgDtc")
dtcDesc = csv.from(csv: csvData2, mode: "raw")
// |> yield(name: "dtcDesc")

join.left(left: orgDtc,
            right: dtcDesc,
            on: (l, r) => l.dtc == r.dtc,
            as: (l, r) => ({l with descr: r._measurement, righ: r.dtc})
            )