Working with duplicate row items in one column

Hi Guys! I need your help so much. I have a situation, that I am passing data from datatable in UiPath (called in_Table8, passed as an argument inside) to SAP. In this datatable in one column called “Remit No” I have duplicate row items, so the same numbers of documents. I wrote inside if condition the following expression: “in_Table8.Select(“Remit No=’”+row.Item(“Remit No”).ToString+”’").Count>1", because I found in the forum, that will help me with case if there are the same row items in specific column. In Then part I have a problem. “Remit No” is a P column and for these P column are assigned values in a R column. How to sum these values from R column only for duplicated row items in P column (“Remit No”) to have just one item in P column with assigned just one value in R column, which is the sum for duplicated ones? Please help me.

find some starter help that is implementing a GroupBy and sums up the grouped rows.
In your case you could use for grouping P col (find the duplicates when grp.Count > 1)
and sum up the R cols for each group:

GroupBy_Sum_1Col.xaml (7.9 KB)

A more detailed starter help on finding duplicates, non duplicates and first row from duplicates find here:
FindDupsUniquesFirstFromGroup_By1Col.xaml (8.0 KB)

Also have a look on this component and its aggregation activities: