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
7 - Meteor

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_Spill
11 - Bolide

@Neelima1 - see screen shot and workflow attached. Thanks

Round + ToString.JPG

Neelima1
7 - Meteor

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
7 - Meteor

@Bren_Spill 

 

Thank you ... Its working 

Labels