Getting an error using LINQ

Hi UiPath Forum,

I have problems grouping my datatable using LINQ

I tried to get the unique latest entries from a excel file using the code below:

DataTableForPasig.AsEnumerable().Groupby(Function(a) a.Field(Of String)(“TDCX EID").ToString).Select(Function(x) x.last()).CopyToDatatable()

but I am getting an error message below:

I have the two data tables initiated

Hope someone can help me

Thanks and Regards,



Provide sample input and output.

Hi Please see below the sample input and output

As you can see I disregarded the old entries of employee A

Sample Input and Output.xlsx (12.3 KB)


Can you try the following expression?

DataTableForPasig.AsEnumerable().Groupby(Function(a) a("TDCX EID").ToString).Select(Function(x) x.last()).CopyToDatatable()



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