Compare two DataTable (Huge data)

have requirement like First data Tble1 data

EmpDate EmpNum Code
12/02/2019 12345 423
12/03/2019 12346 424
12/04/2019 12347 425

sencond data table as
Date Num Code1
12/02/2019 12345 423
12/03/2019 12346 423
12/04/2019 12347 425
Based on this Matching condition EmpDate<=Date and EmpNum=Num and Code=Code1 Based on this condition I have to add second data table record to data Table as output like wise I have to do for all records
Note:Here First data table first record has to compare with all the records of second data table as per above condition and based on successful match I have to get secondDatatable record to datatable…Can I expect Invoke code for this why I am going invoke is because my data table having huge data

Hi @Prad

Have you tried the join data table activity? You can specify all the conditions you have in it to get the matching records. I believe that will work for you

1 Like

Can I get xaml?

Try this post. It has a sample xaml file too…

1 Like

Hi @Prad,
Do you want to loop through the data tables like 1 record through all the records of other data table?
Then we can use 2 for loops nested for this scenario.
Cheers
Vashisht

I can use loop in loop if I am having less data…But I am having lakhs of records…

HI @Prad

Did the shared workflow work for you? If not, let know so that we can figure out another approach that suits you better

The provided XAML not working for my scenario can I get another XAML which suits my requirement…

Could any one please answer this

Hi @Prad

Sorry for the late reply…

Check this workflow. This includes a Join Data Table activity which you can use to join datatables.
JoinDataTables.xaml (6.8 KB)

Here its joining the result of two match records data… But I wanted based on match second table data Date Num and Code1 details required…

And also after this joinining output of date coming as number ex:43291
43293
43295
this is also one issue with above code

HI @Prad

Check this out…

With the join, I also added few activities to remove the data columns of the first data table. I’m also attaching the excel file I used to do this. It includes the same dataset you mentioned in your first post. For me, date works fine.

JoinDataTables.xaml (8.4 KB)
CheckFile1.xlsx (9.9 KB)

Code working and even its huge data …really thank you…But if the first table EmpDate 12/03/2019 and second table date 13/03/2019 EmpDate<=Date condition not satisfying …

I think here its considering as mm/dd/yyyy format I guess…

@Prad

Yes. It considers the mm/dd/yyyy format :slight_smile:

1 Like

Thank you Fernando…

1 Like

If that worked for you, please mark my answer as the solution too :slight_smile:

Good luck and happy automating :slight_smile:

1 Like

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