Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

How do I remove the $ from a number without removing the negative dash

Lizbhernan
8 - Asteroid

I am working on a workflow and I am having issues removing the $ and ()  from my amounts with it also removing the -. I tried the formula   IIF(Contains([Reimbursement3], ''), +Trim([Reimbursement3],"($)"), [Reimbursement3]) and it did in fact remove the $ and (). However, it also removed the - on the negative amounts. I tried a few different things but nothing has worked. Does anyone have any suggestions on how I can remove the dollar sign and parenthesis and keep the -  example: ($307.96)

 

I have also included a sample of what I am working on and the desired results.

 

TIA for taking time to assist me.

2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

You can use the "(" sign in the orignal field.

Here is a sample solution.

 

Formula

new_Reimbursement3 = ToNumber(REGEX_Replace([Reimbursement3], "[$\(\)]", ""))

new_Reimbursement3 = IF StartsWith([Reimbursement3], "(") THEN [new_Reimbursement3] * -1 ELSE [new_Reimbursement3] ENDIF

 

Result

Reimbursement3new_Reimbursement3
($307.96)-307.96
$168.69168.69

 

I hope this helps.

Lizbhernan
8 - Asteroid

This worked, thank you so much @Yoshiro_Fujimori 

Labels
Top Solution Authors