How to compare two data tables having Name and Value pairs?

Hi All

I have two data tables. Each data table contains two columns Name and Value. I have to compare the two data tables and check if there are any matching and non-matching rows.

Can any one please help me out on this ?

1 dt , 2 dt

  1dt  for each row 
     2dt for each row 
           if(Rows_1dt.item("name") =  Rows_2dt.item("name")
                                         assin    
                   break;

A matching value was found.

Hi @kkpatel,

Use Join Data tables activity to compare those datatables

1 Like

@yundw @aanandsanraj My question is to check if both data tables have same rows or different ?

@kkpatel

For that check the count of both datatable

If dt1.Rows.Count = dt2.Rows.Count

See its a simple question… Its about comparing data. And data in each row is Name Value pair. I have not mentioned in my question that i want to compare just the no of rows.

How Join Data Table can compare the data tables ? Can you explain please ?

@kkpatel
find starter help here:
Find_Common_NonCommon_By1Col.xaml (12.3 KB)

Hi @aanandsanraj

Can you please help on your approach of comparing using Join ?

@kkpatel,

Check this image

If you want to add more column to compare click on the ‘+’ button

It will join. It wont compare and give you the comparison result.

It will get the matched rows between two tables

@kkpatel

Check this XAML test.xaml (10.1 KB)