February 11, 20214 yr I'm trying to make basic addition with values in a field. Field A contains a text of numbers 10,4,2,5 Field B is my calculation field where i want the result of field A. (10+4+2+5) Sum (Field A) just gives me 10425 instead of 21, and i cant find other functions to solve this. Any help is appreciated Edited February 11, 20214 yr by JohnDing
February 11, 20214 yr First thing: if you need to sum individual values, enter them into separate fields and/or records, not in a single field. Next, your field does NOT contain "a set of numbers". It contains text. When you attempt to perform a numerical operation on this text, it is converted to a number by extracting the digit characters. Now, there is a way to sum the values in a comma-separated string: substitute the commas with a "+" character, then use the Evaluate() function on the result. However, if your field contains a trailing comma (as shown in your example), there is an additional complication because: 10+4+2+5+ is not a valid expression. If the field always contains a trailing comma, you could do: Evaluate ( Substitute ( Field A ; "," ; "+" ) & "0" ) to get 21. Edited February 11, 20214 yr by comment
February 11, 20214 yr Author Totally missed Evaluate, that was the missing function. I'm just doing: Evaluate (Field A) To get my 21. The trailing comma was a typo (my bad), and I replaced the commas with "+". Will edit my text to contains text instead of numbers. Thanks again Comment
Create an account or sign in to comment