Joining two datatables

hi all,

I have 2 datatables - dt1 and dt2. there is one column common between dt1 and dt2. I need to use this common column and extract values from dt2 into dt1. No rows should be brought over from dt2 to dt1 if there is no match. All dt1 rows must be present
I am using a left join and it is not going as i want it to.
Anyone has any ideas as to what I am doing wrong?

Thank you,
pari

in general the join datatable activity can do this types of joins. But the result requires a postprocessing (e.g. filtering, moving values to another datatable). Just share some sample data inputs, outputs and we will have a look on it. Maybe a LINQ can help as well.

Please see the attached for sample data.
“VendorCode” in dt1 must look for “Vendor code” in dt2 and bring back the columns from dt2 if there is a match. (kind of a vlookup from dt1)
dt1 sample data.xlsx (8.4 KB)
dt2 sample data.xlsx (8.3 KB)

Thank you,
Pari

a description on the exact expected output is required, due the column schemes are different

Please see the attached for input and expected output files
dt1 sample data.xlsx (8.6 KB)
dt2 sample data.xlsx (8.3 KB)
expected output.xlsx (8.7 KB)

Thank you,
pari

@parimala.prata
find some starter help:
parimala.prata.xaml (10.3 KB)

Inspecting the datatable dtResult it looks similar to your definition. It might be the case that excel can/will do a reformatting of the column format (depends on many factors, also locals). In such a case just readjust the column format with the help of Balarevas component / activity:

grafik

i ended up not using the join as it is causing me confusion. I am using a “for each row” within another “for each row”.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.