Excel Linq You

Can someone please help me with the Linq query for the below requirement??

Input1:

EmpId Name Salary
1 A 10000
2 B 20000
3 C 30000
4 D 40000
5 D 50000
6 E 60000

Input 2:

EmpId Salary
2
4
5
6
7
8

Expected output:

EmpId Salary
2 20000
4 40000
5 50000
6 60000

Input1

Input2
Output

@ppr
@Gokul001
@Yoichi
@Rahul_Unnikrishnan Preformatted text

Hi @Vrishchik

Try this:

Read Range (Input 1) --> dtInput1
Read Range (Input 2) --> dtInput2

Assign (LINQ Query):
  - result (DataTable) =
    (From row1 In dtInput1.AsEnumerable()
     Join row2 In dtInput2.AsEnumerable()
     On row1.Field(Of Integer)("EmpId") Equals row2.Field(Of Integer)("EmpId")
     Where Not row2.IsNull("Salary")
     Select dtInput2.NewRow().ItemArray = {row1("EmpId"), row1("Salary")}).CopyToDataTable()

Write Range (Output) --> Write result DataTable to an Excel file

Hope it helps!!

Hello @Vrishchik , Try this
Read the 2 inputs using the Read range activity
Input 1=DT_Input1
Input 2= DT_Input2

Use assign activity

DT_Input1 = (From row1 In DT_Input1.AsEnumerable()
            Join row2 In DT_Input2.AsEnumerable()
            On row1("EmpId").ToString() Equals row2("EmpId").ToString()
            Select DT_Input1.Clone().LoadDataRow({row1("EmpId"), row1("Salary")}, False)).CopyToDataTable()

Use Write range to write output DT_Input1 in the Excel file