How to compare data in two separate datatables?

Hello friends :wave:

Please consider the below picture

Capture

I’m having the two datatables like above and I want the result datatable to contain the difference in pay if there’s any (in this case A and E have increment and that’s 100 by new pay - old pay)

Can this be achieved? :thinking:

I tried using for loop but its not working in the way I wanted it to so please help me solve this

Thanks :slight_smile:

@Palaniyappan @arivu96 @Lahiru.Fernando could you guys take a look at this one?

2 Likes

May be there are multiple ways to achieve this . but a simple and straight way ( I guess :smile:)

If you have data in excel :

  1. VLookup to get the values for the same name in the old excel and get the new value into the second excel
  2. Then use the formula like C2 - B2 which will give you the difference and filter out as not null.

If it is data tables :

  1. Use for each row of one data table and within that, another data table, and use if condition to check if the names are same and if they are same, then get the values and calculate difference
5 Likes

I had used only one for loop but now I got clarity. Here’s what I did:

  1. Use two for loops one inside another
  2. Check if emp no matches
  3. Check if pay matches
  4. If pay doesn’t match then calculate the incremented amount
  5. Add it to add data row

Thanks for your help @HareeshMR, appreciate it :clap:

1 Like

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