Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Negative value currency formatting

dnomasur
7 - Meteor

Hi all,

 

Long time reader, first time poster.  This seems like a pretty basic question, but so far I haven't found any other discussion threads covering it.

 

I have a column of numerical values (both positive and negative) that I converted to string so that I could then also format them with a "$" sign.  This works fine for positive values (for example $5.3), but with negative values I'm instead getting "$-5.3".

 

Is there a way to format the negative values differently so that the negative sign appears in front of the '$' sign -- for example "-$5.3"?

 

Any help would be greatly appreciated -- thanks!

3 REPLIES 3
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @dnomasur,

 

You could replace your $- string with -$?

 

Replace([String], '$-', '-$')

 

JonathanSherman_0-1631285424164.png

 

Kind regards,

Jonathan

 

Maskell_Rascal
13 - Pulsar

Hey @dnomasur 

 

Here is how you can do it. 

 

IF StartsWith([Data], '-') THEN Replace([Data], '-', '-$') ELSE '$'+[Data] ENDIF

Maskell_Rascal_0-1631286426434.png

 

Hope this helps.

 

Cheers!

Phil

dnomasur
7 - Meteor

Thanks guys -- I'm sure one of these solutions will work and will try them shortly.  And greatly appreciate the rapid responses!

Labels