Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

REMOVE PARENTHESIS AND REPLACED IT INTO NEGATIVE SIGN

dunkindonut7777
8 - Asteroid

Hi I have a problem removing the parenthesis in an amount field, I want to replaced it into negative sign.

 

For example:

 

Functional Amount
(500)

 

 

then I want to have it as "-500'

 

Can you help me with this one please? 

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

Here is a workflow for the task.

Output:

atcodedog05_0-1606106312114.png

Formula:

"-"+Trim([Functional Amount],"()")

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

dunkindonut7777
8 - Asteroid

Hi thank you for this one. I just got a problem with the positive numbers, they were replaced as negative also, how to convert it without touching the positive numbers?

atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

I have added a condition to handle this.

IIF(Contains([Functional Amount], "("), "-"+Trim([Functional Amount],"()"), [Functional Amount])

Output:

atcodedog05_0-1606106828983.png

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

dunkindonut7777
8 - Asteroid

The formula is intended only for string type data, how about if my date is in double type of data?

atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

Sorry for giving you answer bit by bit😅

Here is the formula

 

ToNumber(
IIF(Contains([Functional Amount], "("), "-"+Trim([Functional Amount],"()"), [Functional Amount])
)

 

Note: datatype of the existing field cant be changed in the formula. Hence you need to create a new column.

 

Please take a look into the workflow.

 

Hope this helps 🙂 Please do let me know if there is more changes required.

Qiu
21 - Polaris
21 - Polaris

@dunkindonut7777 

How about a simple Find and Replace?

1123-clodelegonzales.PNG

marcusblackhill
12 - Quasar
12 - Quasar

Hey @dunkindonut7777 !

 

Another easy solution for you is to use the formula tool with 2 simple replaces like in the print.

marcusmontenegro_0-1606134261342.png

Hope that help you!

Labels
Top Solution Authors