if Table A OPH Value not found in Table B then that line Item has to mention in Table C
Hi,
How about the following sample?
arrtupleDtB = dtB.AsEnumerable.Select(Function(r) Tuple.Create(r("PRFNR").ToString,r("OPH").ToString,r("ZMASAK").ToString)).Distinct().ToArray()
Then
arrDr = dtA.AsEnumerable.Where(Function(r) not arrtupleDtB.Contains( Tuple.Create(r("PRFNR").ToString,r("OPH").ToString,r("ZMASAK").ToString))).ToArray()
Sample
Sample20240117-2.zip (15.0 KB)
Regards,
Hey @sivaramana.relangi ,
Try this,
->Use the “Read Range” activity to read the data from Table A into a DataTable variable, “tableA”.
->Use another “Read Range” activity to read the data from Table B into another DataTable variable, “tableB”.
→ Create an empty DataTable variable, “tableC”.
→ Use an Assign Activity for tableC variable
tableC = (From rowA In tableA.AsEnumerable()
Where Not tableB.AsEnumerable().Any(Function(rowB) rowB.Field(Of String)(“OPH”) = rowA.Field(Of String)(“OPH”))
Select rowA).CopyToDataTable()
→ Use the “Write Range” activity to write the data from “tableC” into Table C in your desired location.
Thanks,
HAPPY AUTOMATION!!
Can you try the below
DT1.AsEnumerable().Where(Function(row1) Not DT2.AsEnumerable().Any(Function(row2) row1("OPH").ToString() = row2("OPH").ToString() AndAlso row1("ZMASAK").ToString() = row2("ZMASAK").ToString())).CopyToDataTable()
Input DT1:
Input DT2:
Output:
Cheers!!