Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

How To: Make Negative Numbers Red and Marked in Parentheses in a Table

Alteryx_KB
Alteryx
Alteryx
Created

How To: Have negative numbers show up red and in parentheses for finance reports.  

 

Use the Formula tool to find any negative numbers (IF [Field1] < 0 THEN "Yes" ELSE "No" ENDIF) and mark them as such in a new field.  Now use the Absolute Value (ABS) function to get a positive number (IF [negative] == "Yes" THEN ABS ([Field1] )ELSE [Field1] ENDIF).


Bring the data into the Table tool.  Select the field with the value you want and create a column rule for, and select Column Rules > Edit. 

 

2019-02-27_14-55-42.png

 

In the modal window, use the formula option to choose the negative values and color them red with a prefix and suffix.


The column that you made the rule for will now display negative values in red and in parentheses in the table.


Comments
laddaram
5 - Atom

how will this work if my column header names are dynamic

kureka
6 - Meteoroid

Hi, I'm using multi-field formulas to do it dynamically. Per the article, the first step is fine (see pic). My second step is multi-field formula pulling these new headers to get absolute values but the condition doesn't work (see bold below). Any advice? Thanks for your help.

 

Second step: If "[Neg_" And [_CurrentFieldName_] And "]" = "Yes" Then Abs([_CurrentField_]) Else [_CurrentField_] ENDIF

 

First Step:

 

kureka_0-1605531441391.png