How to count unique row value & insert into the same excel sheet?

create a report datatable with build datatable activity - dtReport
Columns: Category, Count

use an assign activity
left side: dtReport
Right side:

(From d in YourDataTableVar.AsEnumerable
Group d by k=d("Category").toString.Trim into grp=Group
let ra = new Object(){k, grp.Count}
Select r=dtReport.Rows.Add(ra)).CopyToDataTable

Also have alook here:

1 Like