How to find the sum of values in the collection

Hi,
I have some dynamic value in the collection, like 0.5,0.75,3,4,2 how can I sum these values.

Thanks and Regards,

@Chippy_Kolot

if it is a list then use varlist.Sum()

if the values are in string format inside the list then varList.Sum(function(x) Cdbl(x))

cheers

HI @Chippy_Kolot

Checkout this expression

variable1.AsEnumerable().Sum(Function(a) Cdbl(a.ToString))

Regards
Sudharsan

1 Like

@Chippy_Kolot - Hope this helps

Summation of items in a List - Help - UiPath Community Forum

Hi,
Currently my collection is in double, while providing this Im getting error.
"Sum is not a member of ‘List(Of Double)’.

@Chippy_Kolot

Please check this

Alternately try this

Listvar.AsEnumerable.Sum()

cheers

Hi,
Thanks, Alternative method is working

1 Like

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