(From row In dt1
Join row2 In dt2
On row(“COLLECTION_CONTROL_KEY-Fin”).ToString().Trim() Equals row2(“COLLECTION_CONTROL_KEY-Col”).ToString().Trim()
Let key = If(row(“COLLECTION_CONTROL_KEY-Fin”).ToString() = row2(“COLLECTION_CONTROL_KEY-Col”).ToString(),“Match”,“No Match”)
Let dates = If(row(“EFFECTIVE_TRANSACTION_DATE_KEY-Fin”).ToString() = row2(“DATA_FROM_DATE-Col”).ToString(),“Match”,“No Match”)
Let amount = If(row(“AMOUNT_Fin”).ToString() = row2(“ORIG_EXPECTED_AMOUNT-Col”).ToString(),“Match”,“No Match”)
Let ra = New Object(){row(“COLLECTION_CONTROL_KEY”), row2(“Key”), key}
Let ra = New Object(){row(“COLLECTION_CONTROL_KEY”), row2(“Dates”), dates}
Let ra = New Object(){row(“COLLECTION_CONdt2dt1dt1dt1TROL_KEY”), row2(“Amounts”), amount}
Select dtResult.Rows.Add(ra)).CopyToDataTable
(From row In dt1
Join row2 In dt2
On row("COLLECTION_CONTROL_KEY-Fin").ToString().Trim() Equals row2("COLLECTION_CONTROL_KEY-Col").ToString().Trim()
Let key = If(row("COLLECTION_CONTROL_KEY-Fin").ToString() = row2("COLLECTION_CONTROL_KEY-Col").ToString(),"Match","No Match")
Let dates = If(row("EFFECTIVE_TRANSACTION_DATE_KEY-Fin").ToString() = row2("DATA_FROM_DATE-Col").ToString(),"Match","No Match")
Let amount = If(row("AMOUNT_Fin").ToString() = row2("ORIG_EXPECTED_AMOUNT-Col").ToString(),"Match","No Match")
Let ra = New Object(){row("COLLECTION_CONTROL_KEY"), row2("Key"), key}
Let rb = New Object(){row("COLLECTION_CONTROL_KEY"), row2("Dates"), dates}
Let rc = New Object(){row("COLLECTION_CONTROL_KEY"), row2("Amounts"), amount}
Select dtResult.Rows.Add(ra)).CopyToDataTable
As only the matching rows will be passed to the further processing there will no be Non-Matchers which makes the below obsolete
Before stepping in other possible correction needs we recommend to focus on the overall goal. Maybe you can share it with us along with some sample data
Also have a look here for the different join types:
CollectionControlKey
The values from this column acts as a unique identifier, it will either be in both or in the one but not the other. It can also be duplicated.
Please help, how to add the 3 objects to the table with:
Select dtResult.Rows.Add(ra)).CopyToDataTable
(From row In dt1.AsEnumerable
Join row2 In dt2.AsEnumerable
On row(“COLLECTION_CONTROL_KEY-Fin”).ToString().Trim().ToUpper() Equals row2(“COLLECTION_CONTROL_KEY-Col”).ToString().Trim().ToUpper()
Let cckey = If(row(“COLLECTION_CONTROL_KEY-Fin”).ToString() = row2(“COLLECTION_CONTROL_KEY-Col”).ToString(),“Match”,“No Match”)
Let dates = If(row(“EFFECTIVE_TRANSACTION_DATE_KEY-Fin”).ToString() = row2(“DATA_FROM_DATE-Col”).ToString(),“Match”,“No Match”)
Let amount = If(row(“AMOUNT-Fin”).ToString() = row2(“ORIG_EXPECTED_AMOUNT-Col”).ToString(),“Match”,“No Match”)
Let ra = New Object(){row(“COLLECTION_CONTROL_KEY-Fin”), row2(“COLLECTION_CONTROL_KEY-Col”), cckey}
Let rb = New Object(){row(“EFFECTIVE_TRANSACTION_DATE_KEY-Fin”), row2(“DATA_FROM_DATE-Col”), dates}
Let rc = New Object(){row(“AMOUNT-Fin”), row2(“ORIG_EXPECTED_AMOUNT-Col”), amount}
Select dtResult.Rows.Add(ra)).CopyToDataTable