The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

If statement blanks, 1, and 0

Neico
7 - Meteor

Hi!

 

I'm trying to create a VarNEW with the following logic:

If Var1 and Var2 are null then VarNEW is also null. If Var1 is 1 then VarNEW is 1. If Var2 is 1 then VarNEW is 0.

 

Var1Var2VarNEW
...
.10
1.1
1.1
...
.10

 

I cannot seem to get a suitable formula working. Can you please help?

 

Thank you!

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @Neico 

 

Formula

IF IsEmpty(Var1) and IsEmpty(Var2) Then Null()

Elseif Var1="1" then 1

Else 0 Endif
atcodedog05
22 - Nova
22 - Nova

Hi @Neico 

 

Here is a workflow for the task.

IF IsEmpty(Var1) and IsEmpty(Var2) Then Null()
Elseif Var1="1" then 1
Else 0 Endif

Output:

atcodedog05_0-1605855964159.png

Workflow:

atcodedog05_1-1605855977623.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Qiu
21 - Polaris
21 - Polaris

@Neico 
Hope this is what you need.

1120-Neico.PNG

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @Neico 

 

Cheers and Happy Analyzing 😀

 

Feel free to reach out if you face any other issues 🙂

Labels
Top Solution Authors