Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
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
21 - Polaris

Hi @Neico 

 

Formula

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

Elseif Var1="1" then 1

Else 0 Endif
atcodedog05
21 - Polaris

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
17 - Castor

@Neico 
Hope this is what you need.

1120-Neico.PNG

atcodedog05
21 - Polaris

Happy to help 🙂 @Neico 

 

Cheers and Happy Analyzing 😀

 

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

Labels