Compare datatables and get count of equal rows

Hello friends,
@AshwinS2 , @arivu96, @Rammohan91, @balupad14, @Florent_Salendres, @vvaidya, @Palaniyappan, @loginerror, @MAHESH1, @Manjuts90

I have 2 Excel files and in those two I’ll be matching a column named “Società” of 1st file with column “Società” of anoter file and when the match happens I want to get that Count of the row at which the match happens.
Can you please share a xaml to do that?
Thank you so much,
Cami :slight_smile:

2 Likes

Hi @CamiCat,

Please check the below zip file…

1.This contain 2 excel files as you said it contains a column with Società and has 5 values.

2.whenever the data matches with both the sheets i am keeping a message box for your reference…

forum.zip (31.5 KB)

Any doubts let me know…

Cheers.
Vashisht.

1 Like

Hi
Cami, you were almost done
Did we try with JOIN DATATABLE activity with those two columns mention for inner match chosen as a join type in the table wizard

Cheers @CamiCat

1 Like

Hi @CamiCat,

1)Take data from first excel sheet into data table DT1 and second excel sheet data into data table DT2.
2)Using assign activity you will get matched data in new data table FinalDT.

FinalDT = (From a In DT1.AsEnumerable Join b In DT2.AsEnumerable On a(“Column_Name”).ToString Equals b(“Column_Name”).tostring Select a).CopyToDataTable.Select().CopyToDataTable().DefaultView.toTable(False,”Name”)

3)FinalDT.Rows.Count will give you number of matching rows present

1 Like