Get unique rows and their count as a datatable

I have data in a datatable1. I want to create another datatable (Output datatable) with unique rows of datatable1 and their count. Refer image attachment for datatable views. Help me!

Table Views

prepare with Build datatable a datatable - dtReport
and configure 2 cols; Col1, Count

use an assign actvity
LHS: dtReport

(From d in YourDataTable.asEnumerable
Group d by k=d(0).toString.Trim into grp=Group
Let ra = new Object(){k, grp.Count}
Select r = dtTarget..Rows.Add(ra)).CopyToDatatable
1 Like

For training info also have a look here:

Hey @Subhash_B !! You can directly use BalaReva.DataTable.Activities!!

It’s really simple and pretty good!

Let me know if it solved your problem!

Thank you. It worked :slight_smile:

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