Alteryx Designer Desktop Discussions

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

Restrict values in variable based on another variable

mbajodah
5 - Atom

Hello Alteryx Community, 

 

I am new to Alteryx and was able to learn and use a lot of its features. There is only simple requirement that I'd like to insert into my workflow and I am not sure how to approach and solve the problem. 

 

What I am trying to ensure in the data prep workflow is to "flag" out any cell values that is not in my desired list. For instance, see the below table. 

 

Variable 1Variable 2Output
A1Okay
A2Okay
A3Not OKAY

So in Variable 1: I have A. What I want to control is Variable 2. My condition is that If Variable 1 is A then Variable 2 can only contain 1 and 2. Otherwise,  return "Not OKAY" 

 

I'd appreciate any help/tips on how to build this logic in Alteryx. 

 

Thanks

 
1 REPLY 1
AbhilashR
15 - Aurora
15 - Aurora

@mbajodah - you could write an if else statment in the formula tool which would go something like:

IF [Variable 1] = 'A' and ([Variable 2] = 1 OR [Variable 2] = 2) THEN 'Okay'

ELSE 'Not Okay'

ENDIF  

Labels