i had some research to SUM datatable from certain column in excell, i found that activity DataTable Manipulation can cover it.
Already tried it but had some error :
Math Operations: Cannot cast DBNull.Value to type ‘System.Double’. Please use a nullable type.
here the Screenshoot :
Output Value (dt_test) using Variable type Double.
anyone please help me recommend solution to SUM value from certain column in datatable excel?
do your column had null values ?
yes my column had null values
i dont know which activity activity you are using , but you can try this linq query in the assign activity . It will handle the null values too using If
sum = dt1.AsEnumerable().Sum(Function(row) If(row(“Oct_2020”).ToString.Equals(“”),0,CDbl(row(“Oct_2020”)))
here sum variable in final will give you the sum of values of column Oct_2020
Already tried ur assign activity with note sum as system.double variable and works perfectly.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.