Add columns of double type in datatable

I m trying to sum up a column in datatable and add the sum in last row.I tried below
convert.ToDecimal(dat.Compute(“SUM(amount)”,“[amount] IS NOT NULL”))
dat.AsEnumerable().Sum(Function(row) row.Field(Of Decimal)(“amount”))

i get diff error for specifiedn below
Assign: Specified cast is not valid.

How can i do that

Hi @ranjani

To add the column of double type , u can use the below linq query in assign activity

 sum=dat.AsEnumerable().Sum(Function(row) CDbl(row("amount")))

Nived N
Happy Automation

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