Free Trial

Alteryx Designer Desktop Discussions

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

why the if formula doesn't work

feiwang
5 - Atom

Hi, I am wondering how should I correct my formula? I want to calculate the difference of ending balance and beginning balance just for 300000+ account number.

clipboard_image_0.png

 

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @feiwang  this syntax should work If [Account Number]> then [Ending Balance] - [OB] Else 0 Endif you don't need " when you are dealing with numbers in formula or in a filter tool only need " for strings.

NickSm
Alteryx
Alteryx

Hey @feiwang,

 

You'll want to remove the quotes around [Ending Balance] - [OB].  The quotes will take it as entering this as a string, not doing a calculation.

Ochampo77
5 - Atom

Ochampo77_0-1646723242560.png

Ochampo77_1-1646723412490.png

 

 Hi Joe, I have similar formula if you can help me! Basically trying to do ABS value of more than "100000", then it's large, if ABS value is less than "100000", then it's small. Not sure why it wouldn't work.

OllieClarke
15 - Aurora
15 - Aurora

Hi @Ochampo77 

If you change the data type to a String, then the following formula will work:

If ABS([TCV USD]) > 100000
Then "Large"
Else "Small"
Endif

The problem with your current formula is that [TCV USD] is a numeric field, and by using quotes you're making 100000 a string. As your output is words, you need your data type to be a string too, but the comparison between 100000 and [TCV USD] has to be numeric.

 

Hope that helps,

 

Ollie

Labels
Top Solution Authors