How to calculate total in datatable?

image

for example
pencil- value1 + value2 +value3 +Value4 +value 5
pen - value1 + value 2 +value 3+ value 4+value5
how to solve

@saninfo273
Can you eloberate your query,Please put input and output

Hi @saninfo273

I think you are asking about the below, If not you can eloborate your query.

Hope it helps!!

Hi @saninfo273

use the below in an assign activity

StringVariable = datatablevariable.AsEnumerable().Sum(Function(x) If(Not String.IsNullOrEmpty(x("ColumnName").ToString()) or Not String.IsNullOrWhiteSpace(x("ColumnName").ToString()), Convert.ToDecimal(x("ColumnName")), 0)).ToString()

Hope it helps!!