Alteryx Designer Desktop Discussions

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

Adding new column

mkierepka
6 - Meteoroid

Hello - I am very new to Alteryx and stated creating my first workflow.   My question is what do I need to do in order to creat a new column and some specific values in it.  For example.  My existing column lists 5 different types (client, golf, tradeshow, training, learning).  In my new column I want to group the different types under two categories only.  So client, golf, tradehow=external and training, learning = internal.  I am stuck on what operation to perfom here. I appreciate your assistance.

 

9 REPLIES 9
DataNath
17 - Castor

Hey @mkierepka in this case, you'd want to create your new field using the Formula tool, with something along these lines as the expression:

 

IF [Type] IN ('Client', 'Golf', 'Tradeshow') THEN 'External' ELSE 'Internal' ENDIF

 

The if statement checks whether or not the Type = client, golf or tradeshow. If it is, it assigns that record to External and if not, Internal. If you need any further help or have any other questions please just shout!

 

DataNath_0-1660312514664.png

DavidSkaife
13 - Pulsar

Hi @mkierepka 

 

Two ways of doing this. One via a mapping and append, the other by a formula. I've attached the workflow with examples of both.

 

DavidSkaife_0-1660312641332.png

 

mkierepka
6 - Meteoroid

Thank you so much.  This is so helpful!

mkierepka
6 - Meteoroid

Thank you so much. 

mkierepka
6 - Meteoroid

May I please bother you with one more question.  What would you suggest I do in this case: if cell is blank use value from another cell in alteryx.

for example

Column A is blank or null and I want to carry over data from Column B.  If a case when column A has data already, I want to keep column A in tact?

 

DavidSkaife
13 - Pulsar

Hi @mkierepka 

 

This formula will work, if you adjust for your columns:

IF isnull([Column A]) or isempty([Column A])
THEN [Column B]
ELSE [Column A]
ENDIF

 

DavidSkaife_0-1660551977726.png

 

mkierepka
6 - Meteoroid

Thank you David. so I had this formula but it is givine me an error message

mkierepka_0-1660587535755.png

 

DavidSkaife
13 - Pulsar

Hi @mkierepka 

 

Double check that the field names you're referencing are correct, and that the fields are null (not just empty). If they're empty you'll need to include the 'or isempty([Fieldname])' clause of the formula as well.

 

If it's still giving you the error are you able to share the workflow so i can take a closer look?

 

 

mkierepka
6 - Meteoroid

I figured it out.  Thank you for all your help!

 

Labels