c# code stage to sum all rows in one of column in a collection

vivekbodduluri

New Member
need c# (linq) code stage, to sum all rows in one of column in a collection, i want to use linq as i have huge number of records

here i had "amount" as a column the output should in a text or number i.e 1234+4321+0099+9900 = 15554
 

Attachments

  • rpa fourm.PNG
    26.3 KB · Views: 84

VJR

Well-Known Member
Hi vivekbodduluri,

I believe you are looking for something like this
https://msdn.microsoft.com/en-us/library/system.data.datatable.compute(v=vs.110).aspx


Refer Sub ComputeBySalesSalesID in the Examples section.
If you do not have any criteria then you can pass the 2nd parameter as an empty string to the Compute.

I haven't made use of this code in BP so I do not know how much BP will accept it in the Code stage although I do not think there should be a problem. But try out and if you face any issues post here and we shall see what can be done.
 
Top