Compare two Datatable using contains

How to compare this two excel files using “Ref. No.” column in vendor excel and “Invoice” column in ledger excel and make match mismatch report in two separate excels containing ref no and am
Vendor.xlsx (8.8 KB)
ount from vendor and invoice no and amount from ledger.
Ledger_ax.xlsx (10.6 KB)

1 Like

Hi @Debojyoti_chanda

Can you check the below workflow

FIlter.xaml (15.3 KB)

Regards
Gokul

Hey @Debojyoti_chanda

Please find the below ref,

nmnithinkrishna_FindMatchMisMatchBetExcel.zip (22.6 KB)

Hope this helps

Thanks
#nK

Thanks for your reply. The workflow works fine but i also want the matching data from ledger as well. like one excel containing data from vendor like you did and another for ledger as well in the same way.

1 Like

Hey @Debojyoti_chanda

You can please make a copy of the same logic with the data table interchanged in the join and linq assign we have used.

Kindly try and let us know if any difficulties.

Thanks
#nK

when i interchange the datatables it inner join the output is this-
Output.xlsx (8.5 KB)
and when i change it to left join the output is like this(works for macthed records)-
Output.xlsx (7.6 KB)
in both cases the linq was this
dt_Ledger.AsEnumerable.Where(Function(row) not dt_Matched.AsEnumerable.Select(Function(obj) obj(“Invoice”).ToString).Distinct().Contains(row(“Invoice”).ToString)).CopyToDataTable.DefaultView.ToTable(true,{“Invoice”,“Amount”})
but gives error in left join

1 Like

Okay @Debojyoti_chanda

Let me update it no worries.

But just correct my understanding please, so you want to do the same approach for both the data tables.

Thanks
#nK

yes…just like you made a match mismatch using vendor data i want another report containing match mismatch for ledger data

1 Like

Clear will update and post it.

Thanks
#nK

1 Like

Hey @Debojyoti_chanda

Please find the updated version.

nmnithinkrishna_FindMatchMisMatchBetExcel_v2.zip (22.0 KB)

Thanks
#nK

the matched values with “.” are going in mismatch sheet and no mismatch values is getting printed

1 Like

Hey @Debojyoti_chanda

Mismatch values getting printed for me…

And regarding the dot, could you please remove it if its by mistake or the nature of input is that ?

Thanks
#nK

this data is actually matching with vendor and should be in matched sheet


this is not in vendor sheet so should be in mismatch sheet

1 Like