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 each.one 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")))

Regards,
Nived N
Happy Automation

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