Hi,
I have a table (example below)
I want to create column (called RESULT) which is a sum of columns a,b,c,d,e,
For this purpose I used Formula tool and put there instruction:
[a]+[b]+[c[+[d]+[e]
I received an error 'Type mismatch in operator +'
My assumption is that it is because of data format in a,b,c,d,e (VString and Double).
Can you please help me how to solve this problem?
I do not want to use ToNumber as in my real table I have around 30 columns that I need to add to receive the 'RESULT'
Thanks in advance for your help!
a | aa | b | bb | c | cc | d | e | RESULT |
10 | nn | 1 | ww | 5 | we | 11 | 2 | ? |
12 | oo | 2 | ww | 6 | wqw | 11 | 3 | ? |
11 | oo | 3 | ww | 7 | wew | 11 | 33 | ? |
14 | ooo | 4 | we | 8 | wert | 11 | 22 | ? |
Solved! Go to Solution.
Hi @JustynaMZ ,
Can't you use a select tool before that formula tool to change the data type to numbers for all columns included in that expression?
The select tool will allow you to change the data type from a dropdown list, so changing al V_String to Double should be enough
Hi @JustynaMZ
There's a workflow with some options, I take it that the Dynamic Select won't work, if your numeric fields aren't set as numeric data types, but the top option should work for you....
Hi @JustynaMZ
If you do not want to use the ToNumber, your only option pretty much is to manually change the columns to the double format with the Select tool and change it back afterwards.
However, be careful because the moment you change it from string to double, whatever does not fit in the double format will become null, so you may lose important data and not realize it.
I believe the best method is to definitely use the ToNumber(), it would be a quite large function, but it would make sure you did not lose any data.
Pedro.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |