Free Trial

Alteryx Designer Desktop Discussions

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

Using the IF and IN in the same formula

Tim6
8 - Asteroid

Hi There, 

 

I have a formula:

IF [Goal] IN("K-4", "R-2", "M-3", "Z-1") THEN "Yes" ELSE "N/A" ENDIF

 

There is a item in my data set that has a "K-4" and thus should be "Yes" but alteryx is not recognizing this. 

I have cleansed the data of white spaces. 

 

Can you please let me know what you think. 

Thank you

6 REPLIES 6
AbhilashR
15 - Aurora
15 - Aurora

The formula should have worked. Could you provide us some sample data for us to look at? Just a couple of values from the Goal column should do.

RobertOdera
13 - Pulsar

Hi, @Tim6 

 

Try this instead (nest the Goal in a TRIM).

 

IF TRIM([Goal]) IN("K-4", "R-2", "M-3", "Z-1") THEN "Yes" ELSE "N/A" ENDIF

 

I hope this helps!

 

Tim6
8 - Asteroid

Hi There, 

 

Please see attached

Tim6
8 - Asteroid

i tried  this but it didn't work - thank yo for trying.

RobertOdera
13 - Pulsar

Hi, @Tim6 

 

I think the problem is not in the data but rather in your column name.

 

Your column reads as "Goal " i.e. with spaces

 

Either manually correct by removing all the spaces before and after, so that you have "Goal" OR

 

If this is coming in from another source, then Alteryx it using Dynamic Rename Tool configured per below.

 

RNO2_0-1587493680338.pngFor_Tim6.PNG

 

 

RobertOdera
13 - Pulsar

Thanks @Tim6 

Please don't hesitate to reach out to the community, if you need anything else!

Labels
Top Solution Authors