How to count duplicate rows in a column of the same excel sheet and write it to the new excel file


prepare the report datatable with build datatable activity - 2 Cols: Column A, Column B - dtResult

Use an assign activity:
left side: dtresult
Right side:

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

Also Have a look here:

1 Like