Sum of an specific Column in a Data Row

Hi! I would like to know how to make the sum of an specific column in a Data Table.
The dataTable takes the values from an excel and these are the output columns

I want to make the sum of the “Invoice Amount” column.
Also the name of that coumn is variable, so how to make the sum of the column wich name is stored in a variable?

give a try on

Assign activity
LHS: SumIA | datatype: double

YourDataTableVar.AsEnumerable.Sum(Function (x) CDbl(x(YourColNameOrIndexVar).toString.Trim))
1 Like

Thanks it worked!
One thing more, how can I convert the resulted number into only 2 decimals?
The result of the sum is 678544.900000086
how cpuld I end only with 678544.90?

A string based option could look like this:

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