How to sum the output in a column

hi,

Im trying to assign a variable that is the sum of all amount found in a column. i keep getting incorrect “input string incorrect” error striing. Please see the sample ss below;

I want to achieve is to get the sum of all invoice number for each batch number. Thanks

please try this.

dt.asenumarable().sum( function(x) Convert.toint32(x.field(of Object) x(“your column name”))).

if you have any empty values then it throws exception. So try to remove the null/empty values

i hope this works. :slight_smile:

1 Like

@julius.mapili - You have to convert the String into Int32 and the proceed to Sum the values. It will work.

Thanks,
AK.

dtFileter.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(“columName”).ToString.Trim) ).ToString

make sure convert as double

2 Likes

Thanks!

Thanks

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