Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

IF condition + Calculation

Amy123
8 - Asteroid

Hi Team,

 

need a logic and formula :_

 

If BO = 0 then TC Amount - FC Amount ELSE IF BO! = 0 then FC Amount - BO 

 

How to write this logic can anyone help

 

 

TC AmountFC AmountBOVariance 
500005000000
122332222122210
2113223232232320
4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @Amy123 

 

Here is how you can do it. Your formula was almost there. If it doesnt meet both the condition output is null.

 

Formula:

 

If [BO] = 0 then [TC Amount] - [FC Amount] 
ELSEIF [BO]!= 0 then [FC Amount] - [BO]
Else Null()
Endif

 


Workflow:

atcodedog05_0-1630670514906.png

 

Hope this helps : )

 

bensilv
Alteryx Alumni (Retired)

Hi @Amy123 

 

Can you elaborate on what the issue is? It looks like your formula would work perfectly fine in Alteryx! Just use a formula tool with that logic.

 

If you have 2 conditions, you'll need an ELSE condition to catch the rest.

 

bensilv_0-1630670721362.png

 

 

 

bensilv
Alteryx Alumni (Retired)

For the ELSE condition, you can implement either mine or @atcodedog05 's solution (depends if you want it to be null or a 0)

 

Speedy as always @atcodedog05 😉

Kamran1991
11 - Bolide

@atcodedog05  has the solution for almost every Alteryx problem, I have noticed in last 6 month. Keep it up. 🙂 

Labels
Top Solution Authors