I have a table with some data and every row as assignee name, I have around 100 records with diff assignees, but I have to pull only any 5 rows for each user from the data table. Kindly help me to filter this scenario,
Thanks in advance.!
SampleData.xlsx (9.4 KB)
Have a look on the thread
How about the following?
dt = dt.AsEnumerable.GroupBy(Function(r) r("Assignee").ToString).SelectMany(Function(g) g.Take(5)).CopyToDataTable
We do understand following:
for each user pickup up randomly 5 records belonging to the user
Readin excel, grouping the data, Preparing the result table
Process the groups
Find starter help here:
ppr_ExcelBox_RameshKola.xaml (12.4 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.