Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to see if column contains list of values then create new column?

cmnflom
6 - Meteoroid

I have a workflow with a list of Excel values that is to be used as a reference. The Excel file has 1 column called [Item Description] and has 346 rows of unique descriptions.

 

I have another main data table input (9,000 records) with the same [Item Description] column that I will be joining with this Excel file. 

What I am trying to do is the following:

If the [Item Description] from the Excel file exists in the [Item Description] from the data table, then create a new column [Area] = "YES".

 
I have tried to accomplish this several ways but am struggling to get the output that I am looking for. Any help or suggestions would be greatly appreciated.

5 REPLIES 5
echuong1
Alteryx Alumni (Retired)

You can take advantage of a Join in this scenario.

 

Essentially, anything that joins based on the description field would be in both datasets. From there, I've used a formula to create a field called Area with a value of Yes. Anything that didn't join from the main dataset would come out of the L or R output (it depends on which input was which). In my case, they came out of the R output since the full dataset was the R input. I used a union to stack what matched and what didn't match back together.

 

echuong1_0-1613526175584.png

 

SeanAdams
17 - Castor
17 - Castor

Hey @cmnflom 

 

As @echuong1  says, you can either do this with a join tool (as demonstrated below) your you can do this with a find/replace tool - with the setting turned on to add a column.

cmnflom
6 - Meteoroid

The issue I'm running into is that the reference file Item_Description column only contains a portion of the data contained in the main table.

 

For example, say the main table Item_Description is:

 

Apple Macbook Pro 15" 2015

 

The excel file Item_Description contains:

Apple

 

What I am trying to do is see which items in the excel file Item_Description match the main table description, and then pull the main table values (i.e. the full description)

 

I have tried the above two methods, but I have not been able to pull the full description. Do you have any suggestions?

cmnflom
6 - Meteoroid

Thank you for the reply! I tried this method did not work with my data - please see my comment below. Do you have any other suggestions for this scenario?

echuong1
Alteryx Alumni (Retired)

Try using the Find and Replace.

 

echuong1_0-1616076470992.png

 

Labels