Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Show negative numbers in parentheses

Analyst
6 - Meteoroid

Does anyone know of a way (in the Reporting Tools) to show negative numbers in parentheses instead of with a "minus" sign in front of them?  I know that I can convert them to strings, blah blah blah, formula tool blah blah.  I was wondering if there was just a way to change how they are displayed with an option or button click instead of writing formulas.

 

This is kind of a metaphor for my whole career existence.  Being a BI analyst, I have to translate between IT and Operations.  IT sees it as a decoration, a mask on the true value of the data, Operations wants uniformity; it must always be "$   (10)", not "-10".  While this is a minor inconvenience, it makes any financial reporting in Alteryx a bit tedious.  

7 REPLIES 7
JoeM
Alteryx Alumni (Retired)

@Analyst

The closest I can get you with reporting tool clicks is '$(-10)', but not '$(10)'. Sounds like you are tired of writing the same formula repetitively, and the function to get it exactly as you need it can't be configured in the reporting tools. Have you considered building a macro to do this quickly for you? Attached, I built a quick sample macro that shows allow a user to select all numeric fields to convert to your negative number format and output them as a new field you can use for your reporting. 

Analyst
6 - Meteoroid

@JoeM,

Thanks for the help, good sir.  You say you can get to '$(-10)' but not '$(10)'.  What about '(10)'?

 

In the mean time, I'm going to try the macro route, that may well do the trick for me.

Analyst
6 - Meteoroid

Joe, 

I'm looking at the macro and when it does the conversion from '-1,234' to '$(1234)', it loses the comma.  I definitely have to keep the commas in the figures.  Is there a way to retain those?  Thanks again for the help, it is much appreciated.

 
 
JoeM
Alteryx Alumni (Retired)

No problem. The tostring() functions has the capability to add decimal places or commas. I updated the macro to reflect what you need: 

tostring([number],<putnumberofdecimalplaceshere>, <put 1 here if commas are desired>) 

Analyst
6 - Meteoroid

Much obliged my good man.  Now I have one more question if you don't mind.  How did you "mention" my name in your first reply?

JoeM
Alteryx Alumni (Retired)

No problem! You can mention people by typing "@" and then being writing their name. 

kgreen
5 - Atom

This macro file is great and exactly what I need, however once I ran it now my positive numbers lost the comma. Not familiar enough with macro's to know how to add it in. Thanks!

 

Labels