I have a data table im pulling and it gives me something that looks like this. On the left I have some duplicate numbers. So i need to find all the ones that match on the left and take the sum of all the numbers to the right of it and have one row for that number. So for the first one it would get rid of 6 of the 100012 and just keep one with 2,870 in the other row.
prepare the report table with build datatable (configure two or needed coumns)
OR
Assign activity
LHS: dtReport | datatable
RHS: YourOriginDataTable.Clon
then use again an assign Activity
LHS: dtReport
RHS:
(From d in YourOriginDataTable.asEnumerable
Group d by k=d(0).toString.Trim into grp=Group
Let s = grp.Sum(Function (x) CInt(x(1).toString.Trim))
Let ra = new Object(){k,s}
Select r=dtReport.Rows.Add(ra)).CopyToDataTable
Read Data - DT
Assign UniqueDT= DT.defaultview.totable(true,“ID”) – here i assume 1st column is ID
Build Datatable as DT_Out → same columns
For Each row —> UniqueDT
Filter Data Table —> DT as input and DT2 as output
Condition as —> column 0 = row(0).tostring
Assign ----> Total=0
For each row —> DT2
Total=TOTAL+ROW(1).TOSTRING
after 2nd for each use Add data row for DT_Out with Array Row as ----> {Row(0).tostring,Total}