Get common data

i have 2 excel d1 and d2

i want all data that is common in both sheet wilth all traxn no and date
D1.xlsx (8.5 KB)
D2.xlsx (8.2 KB)

Hi @manoj_verma1
Are you referring to comparing data between two sheets?

Regards,
TuanNNA

Hi @manoj_verma1,
Use the below expression by mentioning the reference column to get the common data between the two data tables.

inputDT1.AsEnumerable().Where(Function(row) inputDT2.AsEnumerable().Select(function(r) r(“ColumnName”).ToString).Any(Function(x) x = row(“ColumnName”).ToString)).CopyToDataTable

1 Like

compare d2 to d1 and get all comon data same as d1 has

Hi @manoj_verma1

How about this expression

dt1.AsEnumerable().Intersect(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable

Regards
Gokul

Hi @manoj_verma1 ,

Check this below attached workflow and I have used above files which you shared,
Uipath_GetCommonData.xaml (7.4 KB)

Hope this might help you :slight_smile:

6 Likes

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