Sum of a ligne of a column

studio

#1

Hi,

I’m trying to sum all values of a colums using: *
BUS_Datatable_test.Compute(“SUM(Columnname)”, “”).ToString

got this: Assign : Syntax error in aggregate argument: Expecting a single column argument with possible ‘Child’ qualifier.


#2

Hi @abdel,

Take a look this activity.

Regards
Balamurugan


#3

@abdel use this

BUS_Datatable_test.AsEnumerable.Sum(Function(x) If(IsNumeric(x(“Columnname”).ToString.Trim),CDbl(x(“Columnname”).ToString.Trim),0))


#4

hi @abdel

you can check it with this

Convert.ToInt32(BUS_Datatable_test.Compute(“Sum(“Column Name”)”, “[“Column Name”] > 0”));

Thanks
Ashwin S


#5

there is a validation error.

constante name must contain one caractetr


#6

Hi @abdel

Check this linq query

BUS_Datatable_test…AsEnumerable().Sum(x=>x.Field(“SomeProperty”));

Thanks
Ashwin S


#7

can’t find ASenumerable as methodes. for dt.


#8

hI @abdel

BUS_Datatable_test.AsEnumerable().Sum(x=>x.Field(“SomeProperty”));

previously it was with 3 dots

Now you check

Thanks
Ashwin S