Alteryx Designer Desktop Discussions

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

Reg or if/then?

kiwipops
6 - Meteoroid

Hi all! I am having issues with my formulas overwriting others. My column A has several different options (5+), and based on those 5 options I need text to output into column B. I can get my first formula working, but when I try to add a formula or tack on to the existing one, it basically overwrites the prior formula. It should work like this:

 

kiwipops_0-1576791123222.png

 

Where: Go or Stop = W, Fun or Boring = G, etc. So there's multiple values in column A, but less values on the output into column B (grouping fields). My initial Go or stop = W reg formula works, but if I add another formula (any way) next it ignores my prior formula. I hope I'm making sense--thank you in advance!

5 REPLIES 5
fmvizcaino
17 - Castor
17 - Castor

Hi @kiwipops ,

 

Would you be able to share a sample data and a small example of what is your problem and what you want to achieve?

If you could, please share your formula as well.

 

Best,

Fernando Vizcaino

ScottE
Alteryx
Alteryx

Hi @kiwipops 

 

You could try a nested IF:

 

IF [col_A] IN ('go','stop) THEN 'W'

ELSEIF [col_A] IN ['fun','boring') THEN 'G'

ELSEIF...............

ELSE ''

ENDIF

 

you can keep going with ELSEIF for each group.

 

Another option would be to use a Text Input tool and create a lookup table for all your groups and then join it in. 

 

Hope that helps!  

 

T_Willins
14 - Magnetar
14 - Magnetar

Hi @kiwipops,

 

You should be able to do this with a IF/THEN/ELSEIF formula.  With a Formula tool creating Column B use the formula:  IF [Column A] IN ("Go","Stop") THEN "W" ELSEIF [Column A] IN ("Fun","Boring") THEN "G" ELSEIF ... ENDIF with the ... being the other tagging.

fmvizcaino
17 - Castor
17 - Castor

Hi @kiwipops ,

 

Take a look at the attached example. I'm using one if clause to write everything to the column B.

 

Let me know if that works for you.

Best,

Fernando Vizcaino

kiwipops
6 - Meteoroid

Thank you, all! Looks like I have a few options. 🙂

Labels