How to compare columns from two datatables from excel and if it matches writing its status in status column specific to that row

Hi All,

I am trying to compare columns of two datatables and if the value matches of any column i need to update it in status column specific to that particular row only where the value has matched.

Step1- What I have done is one for each row for 1st dtb and inside that for each control loop for 1st dtb cols…than inside that for each row of 2nd dtb and inside this for each control loop for 2nd dtb cols…and than finally inside the second for each control loop…I am using if else to compare both the dtb cols , but unfortunately it iterates and increase the col value for second dtb only and first dtb cols remains constant.

Step2- And have done the same thing with lookup, just used lookup inside the second for each control loop of 2nd datatable and provided its properties values as Datatable=“Datatable1”, Lookup Val= “row(dtcol1).ToString”, Lookup col=dtcol1

For both the above steps it is giving me error "Column ‘Name’ does not belong to table Datatable "

have attached the screensht and the zip file with xaml file and dummy data.

Thanks.

CompareColsfromTwoDTBandAddstatusCol.zip (28.8 KB)

Hi All,

I found out solution for it, I have attached the zip file for the same which has xaml file and the data.
It will compare each row of each column and if the data matches with the second data table it will add status as matched under status column…i have added the status in second data table. However you can add it to first table or any new excel table.I have used it with dummy data.But, it is very useful in terms of real time scenario with real time data, while comparing and adding the status.

If any queries related to this or any alternate solution, please comment or reply to this topic.

ThanksCompareColsfromTwoDTBandAddstatusCol.zip (31.3 KB)

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