In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

if is not null condition with "Round" and "Tostring"

Neelima1
8 - Asteroid

Hello,

 

I want to write a formula with an if is not null condition along with to string and round also add a "%" symbol

 

We have 3 fields 

 

1. Current amount

2. Previous amount

3. Variance ( current amount - previous amount)

 

new field should be a percentage with a formula like below, however I am missing some logic in closing the parenthesis. Please guide.

 

ToSTring(Round(if(!IsNull([Previous amount])) then

 

([Variance]/[Previous amount])*100,0.1)) + "%"

 

else [Current Amount]/[Previous amount])*100,0.1) +"%"


endif

 

 

 

4 REPLIES 4
ShankerV
17 - Castor

Hi @Neelima1 Can you please share some samples (examples) 

Bren_Spill2
12 - Quasar
12 - Quasar

@Neelima1 - see screen shot and workflow attached. Thanks

Round + ToString.JPG

Neelima1
8 - Asteroid

New formula should be merging of below two formulas. attached the file with excel workings

 

ToSTring(Round(([Variance]/[Previous amount])*100,0.1)) + "%"

 

if(!IsNull(([Previous amount]))) then [Previous amount]/[Current Amount]*100 else [Current Amount]/[Previous amount]*100 endif

Neelima1
8 - Asteroid

@Bren_Spill2 

 

Thank you ... Its working 

Labels
Top Solution Authors