Hi all,
I’m having a complete brain-freeze today and cannot work out how to count the number of unique rows in a datatable.
I have an existing table like this:
And I need to get it to this:
Any help would be appreciated, thanks!
Hi all,
I’m having a complete brain-freeze today and cannot work out how to count the number of unique rows in a datatable.
I have an existing table like this:
And I need to get it to this:
Any help would be appreciated, thanks!
@adam.williamson
Customized to your case:
(From d In dtData.AsEnumerable
Group d By k1=d(“Postcode”).toString.Trim, k2=d(“Peril”).toString.Trim Into grp=Group
Let ra = New Object(){k1,k2,grp.Count}
Select dtStatistic.Rows.Add(ra)).CopyToDatatable
Thank you!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.