Sumup the value in column

Hello @priyankavivek
You can use Linq Here
First we’ll Create a list of a double Variable and assign this Code
(From row In DT.Select Group row By id=row("C2") Into gg = Group Select gg.Sum(Function(r) cdbl(r("C3")))).ToList
it’ll group by the table get the sum of number in 3rd column

Second
group by your Datatable using this code
(From row In DT.Select Group row By id=row("C2") into gg = group select gg(0)).copytodatatable

Then create another Datatable Variable and create a default view of it with just two columns 1st and 2nd one using this code
DT.DefaultView.ToTable(False,"C1","C2")

Than use a Add Column Activity and Create a New Column

Than using For each row Assign this value to the newly created Column
dbl(dt1.Rows.IndexOf(row)).ToString

and in the end use a Write Range Activity to get the desired Output
check this workflow for better understanding
GroupBySum.xaml (12.2 KB)

1 Like