Check the Two Columns Data in Different Sheets Using Linq

I would like to know Linq for my solution. I have already tried to complete this task by using ForEach Activities,

But it’s take too much of time, So kindly assist me, With Linq

In this excel, I need to check the value in Role column of Sheet1 and Sheet2, - Output for this in the sheet “Sheet1_role_salary”

If the value is same then Check the salary column in both Sheet1 and Sheet2 in Excel file, - Output for this in the sheet “Sheet2_role_salary”

Both Columns(Role & Salary) Are same then Check the Value (Team.Id) Column of Sheet1_role_salary and Sheet2_role_salary,

If the value is same then Write the data in identical Sheet , If the values is not same then Write the data in Different Sheet.

@Yoichi @Anil_G @ppr @supermanPunch @Palaniyappan @Nithinkrishna @fernando_zuluaga @RAKESH_KUMAR_BEHERA

Attach the Excel File ,

New_Excel.xlsx (12.6 KB)

1 Like


For this use a join datatable activity on salary and role and you would get the output directly

For this now join on role,salary,id

If you do full join you will get unmatched records as well


Regards for the response ,

  • But This method not match for Given scenario , Because my input sheets too many different columns and this scenario not only get the join data table, sheet1 and sheet2 match the (roles and salery) and match the sheet1 values write one sheet,and match the sheet2 values another sheet.
  • Finally check the once matched sheets columns(roles & salary) , then check ( and also find the identical values and write the different sheet and different values write the different sheets.


If you do a full join…you will get both match and unmatched records

Please chekc this thread I have explained in detail

For unmatched records and matched records you only need to filter separately

Any extra columsn you dont need also can be removed in filter datatable activity


I thankful for your time ,

  • But Not need for join two Data table.I need Compare the columns ( salary & role) in sheet1 and sheet2 then Values are equal sheet1 data stored in various sheet and equal sheet2 values store the various sheet.
  • Then this matched sheets compared once (salary&role& ,then equal values store the identical sheet. not equal values stored in different sheets.
1 Like


Anyways …comparing for equality is nothing but join…


I thankful for your time,
- I need only Compare column values and equal values are write various sheets Pls check my reference excel file. Joining the Data table is not necessary.