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

Alteryx Designer Desktop Discussions

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

How to replace minus sign in negative numbers with brackets?

AYESHASIDIKHA
8 - Asteroid

I have 20 fields with data type Double, In the output I am getting them as -1234567.45367 but the expected output is (12,34,567.45367). 

To convert all the fields we have to use multifield tool, It would be great if you help me in solving this.

 

Thanks in advance

4 REPLIES 4
apathetichell
20 - Arcturus

ues a multi-field formula - convert all of your numeric fields to vstring (you don't need new fields).

 

use the formula if [_CurrentField_] < 0 then "("+tostring(-1*[_CurrentField_]) + ")" else [_CurrentField_] endif

binuacs
21 - Polaris

@AYESHASIDIKHA One way of doing thisimage.png

 

apathetichell
20 - Arcturus

@binuacs - one quick thing - you should use abs([_CurrentField_]) to drop the - sign from inside the () -  you don't need (-12.35) - just (12.35)

binuacs
21 - Polaris

@apathetichell Thank you , I didn’t notice that. Updated the workflow

image.png

Labels
Top Solution Authors