Specify the sum of repeated comments in Column

Hi,
I have Data Table with “Comment” column at the end.
There can be differenet values.
I would like to have sum up:
10x Comment1
5x Comment2
3x Comment3
1x Comment4

How can I do that?

@aleksandra.plichta5

Please try this in assign activity and first use build datatable(dtsum) and add two columns of type string

DtSum = (From d In dt.AsEnumerable() Group d By k=d("Comments").toString.Trim Into grp = Group Let coun = grp.count.ToString Let ra = New Object(){k,coun} Select r = DTSum.Rows.Add(ra)).CopyToDataTable()

Dt is the input datatable
Dtsum Is the output with two columsn one is comment and other is count both as strings
Comments is the column name can change as per your input

Cheers

we can do it by grouping the data

e.g a LookUp Dictionary

Assign Activity:
myLKDict | Dictionary(Of String, int32) =

YourDataTableVar.AsEnumerable.GroupBy(Function (x) x("Comment").toString.Trim.).ToDictionary(Function (g) g.Key, Function (g) g.Count)