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