Alteryx Designer Desktop Discussions

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

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

Neelima1
Meteoro

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 RESPOSTAS 4
ShankerV
Castor

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

Bren_Spill
Bólide

@Neelima1 - see screen shot and workflow attached. Thanks

Round + ToString.JPG

Neelima1
Meteoro

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
Meteoro

@Bren_Spill 

 

Thank you ... Its working 

Rótulos