How to count the occurrences of value

Hi! I’m new to Studio. I have a datatable with one column and multiple rows. I want to get the count of occurrence for each values. However, the values are obtain using Table Extraction from web which caused me not knowing what the values are every time I run the file.
Example:
Value
000
000
000
222
222
352
888

Expected output:
000 3
222 2
352 1
888 1

Even better, if it give me Top 3 occurrences…

@Cari
Welcome to the forum

Use Build DataTable and configure for the report datatable an empty datatable with two columns:
Value, Count - dtReport

Use an assign activity
LHS: dtReport
RHS
(From d in YourOriginDataTableVar.AsEnumerable
Group d by k=d(0).toString.Trim into grp=Group
Let ra = new Object(){k, grp.Count}
Select r = dtReport.Rows.Add(ra)).CopyToDataTable

2 Likes

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