Hi I have a sample data here. I want to replace the "-" characters into 0 as this pertains to numeric columns but it was string when being imported. However, there is also a "-" at the start of the digits of some cells. I just want to replace the cells that have "-" characters entirely.
CODE | BALANCE1 | BALANCE2 | BALANCE3 | BALANCE4 |
39374937 | - | 7700 | 521.98 | 120000 |
54656898 | - | 789 | - | 90000 |
54656898 | - | -890 | 652.46 | 80000 |
54543649 | -2890.67 | 60000 | - | 9000 |
54645648 | - | 600 | - | -68000 |
54646477 | -900 | 8090 | - | - |
Expected Output:
CODE | BALANCE1 | BALANCE2 | BALANCE3 | BALANCE4 |
39374937 | 0 | 7700 | 521.98 | 120000 |
54656898 | 0 | 789 | 0 | 90000 |
54656898 | 0 | -890 | 652.46 | 80000 |
54543649 | -2890.67 | 60000 | 0 | 9000 |
54645648 | 0 | 600 | 0 | -68000 |
54646477 | -900 | 8090 | 0 | 0 |
Can you help me with this one?
Hey @dunkindonut7777, you can use the Multi-Field Formula to handle several fields at once. If you're only looking to replace instances where the whole value is '-' then I'd go with this expression:
IF ToString([_CurrentField_]) = '-' THEN 0 ELSE [_CurrentField_] ENDIF
The benefit of this tool is you can also change the output's data type without creating a new field, so can cast your incoming strings to numeric values when doing the replacement (see the 'Change Output Type to' configuration: