Compare two data tables and remove not Matching rows

i want to compare two data tables and remove not matching rows from the first data table…how can I do that?

Hi!

You can use filter data table activity to achieve your requirement…

Have a look on this image

Dt

Regards,
NaNi

I want to remove not matching rows from the first table and update it in the same excel sheet…am I be able to do that using this activity?

Hi,

Can you try to use Join Datatable activity and Filter Datatable activity?

First, Join two datatable with full join. Then not matching row will be blank.
Next filter blank rows and unnecessary column using Filter DataTable.

Or we can achieve it using LINQ. In this case, can you share more details?

Regards

1 Like

Hi @Althaf_nazeer_Nazeer

create a datatable using build data datatable activity

Put the below syntax inside assign activity ( Out_dt is a output variable from build datatable activity)

Out_Dt=(
From row in Input_Dt1
Join row2 in Input_Dt2
on CStr(row(“your column name”)) Equals CStr(row2(“your column name”))
Select Out_Dt.Rows.Add({row(“your column name 1”),row(“your column name 2”),row(“your column name 3”)})
).CopyToDataTable

use the Out_Dt datatable variable where you want to update

Thanks,
Robin

1 Like