Question
How do you convert a string with a $ sign into a number?
Answer
1. First remove the dollar sign and commas out of the string
2. Convert () to a negative sign "-"
3.ToNumber() function
Input:
Output:
There are many ways to do this in Alteryx, here are a few:
Example 1
Formula Tool - ToNumber(Replace(Replace(Replace(Replace([Data], '$', ''), ',' , ''), ')' , ''), '(' , '-'))
Example 2
Formula Tool -ToNumber(REGEX_Replace(REGEX_Replace([Data], "\$|,|\)", ""), "\(", "-"))
Example 3
RegEx Tool #1 - Replace\$|,|\) with Replacement Text "blank", then
RegEx Tool #2 - Replace \(with Replacement Text "-"
Select Tool - Change Type to Fixed Decimal
See attached workflow.