marco.meli
Member
Hello,
I would like to sum two columns in a Collection, 2 amount columns are string type, so they need to be converted in Int or Double. This conversion is not possibile using Compute method, so why I'm asking a solution for that (maybe a sample with Linq ?)
Inputs:
InputColl Collection
FieldName1 String
FieldName2 String
Output:
TotalField1 String
TotalField2 String
Code:
Dim sumObject As Object
sumObject = InputColl.Compute("Sum(["+CInt(FieldName2)+"])", " ")
TotalField2 = sumObject
Internal : Could not execute code stage because exception thrown by code stage: Conversion from string "Sum([" to type 'Double' is not valid.
Thanks.
Marco.
I would like to sum two columns in a Collection, 2 amount columns are string type, so they need to be converted in Int or Double. This conversion is not possibile using Compute method, so why I'm asking a solution for that (maybe a sample with Linq ?)
Inputs:
InputColl Collection
FieldName1 String
FieldName2 String
Output:
TotalField1 String
TotalField2 String
Code:
Dim sumObject As Object
sumObject = InputColl.Compute("Sum(["+CInt(FieldName2)+"])", " ")
TotalField2 = sumObject
Internal : Could not execute code stage because exception thrown by code stage: Conversion from string "Sum([" to type 'Double' is not valid.
Thanks.
Marco.