Alteryx Designer Desktop Discussions

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

Add % symbol

BRRLL99
11 - Bolide

Hi Team , 

 

 

F2                   F3                              percentage
1950               1960                -0.512820512820513
494547           499614            -1.02457400408859
0                      0                         null

0                      0                         null

 

i used following formula to get percentage column = ([F2]-[F3])/[F2]*100

 

my percentage column should be

-0.51%

-1.02%

0.00%

0.00%

 

After using formula tool i have used select tool to fixed decimal to string and then added % symbol

Please let me know it can be done in same formula tool

 

 

3 REPLIES 3
DataNath
17 - Castor

Hey @BRRLL99, can definitely do this in a single Formula expression! All we need to add to your original expression is the rounding (which the FixedDecimal precision was handling previously), and also a conversion function of ToString() to make it a string before it leaves the expression and we can add the percentage sign. Hope this helps!

 

ToString(Round(([F2]-[F3])/[F2]*100,.01))+'%'

 

1.png

BRRLL99
11 - Bolide

even for last 2 rows,

the result should be 0.00%

Qiu
20 - Arcturus
20 - Arcturus

@BRRLL99 
I believe a Formula tool with below conditional statement should do the work,

If isnull([Percentage]) then '0.00%' else [Percentage] endif
Labels