Hi All,
I have data in datatable type variable. And here “policynumber” column has duplicate values. So, I need to group this.
Any suggestions?
Hi All,
I have data in datatable type variable. And here “policynumber” column has duplicate values. So, I need to group this.
Any suggestions?
Hey,
What action do you want to take with the duplicate values? Just highlight any policy numbers which have duplicates?
Cheers,
Josh
Hi @shuklarchana001 ,
Is this what you were looking for?
dt_sampleData.AsEnumerable.GroupBy(Function(g) g("PolicyNumber").ToString.Trim).Select(Function(s) s.CopytoDataTable).ToList()
GroupandSeperate.xaml (10.3 KB)
Kind Regards,
Ashwin A.K
Hi @shuklarchana001,
Give @ashwin.ashok’s answer a go.
If you simply just wanted to order the data, which would group duplicate PolicyNumbers, but keep it all in one DataTable, try this:
yourDT.AsEnumerable.OrderBy(function (x) x.Item("PolicyNumber")).CopyToDataTable
Kind Regards
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.