Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Identifying Key Words with multiple inputs

Robert31395
7 - Meteor

I am working on a workflow that would take a list of vendor names and key words and match them to another list of vendor names and item descriptions. A field would be added to the vendor name/item description list that would contain the key word or words that matched that particular item description.

 

I was able to create a batch macro that accomplished this but matched all key words to all item descriptions. 

 

I want to make it a little more specific and match both a key word and a vendor name. For example, there may be multiple item descriptions (and vendor names) that contain keyword1 but I only want it to match if the vendor name matches also.

 

I was trying to create a similar macro but I needed multiple inputs - one for the vendor name and one for the key word

 

I have attached a sample workflow with sample text inputs for both the vendor/keyword list and the vendor and item descriptions. The desired output is also in the vendor/Item description text input file.

 

 

8 REPLIES 8
VianneyM
Alteryx
Alteryx

Hi @Robert31395,

 

Please find attached the workflow that follows your logic.

 

VianneyM_1-1577579373974.png

 

One important point in the results, row number 4 has a different result. 

But in fact it should match according to the table "key word input"

 

VianneyM_2-1577579609274.png

 

Let me know if you have any questions 

 

Best,

Vianney

Best,
Vianney
Robert31395
7 - Meteor

Thank you for the quick reply. I would like to allow for the flexibility that the key words could also be key phrases. Your solution would work if it were limited to words but not sure it would work if it were generalized to allow phrases as well as words?

 

Robert31395
7 - Meteor

Thank you for identifying the error in my proposed output. Yes, line 4 should have the output you indicated.

VianneyM
Alteryx
Alteryx

Hi @Robert31395

 

How would you identify between a key phrase and another? 

 

If you use a delimiter like , or ; then you can apply it to the text to rows formula

 

Best,

Vianney

Best,
Vianney
Robert31395
7 - Meteor

I have attached a revised sample input file to be more specific and more representative of what I am looking for

 

VianneyM
Alteryx
Alteryx

Hi @Robert31395,

 

Attached the workflow that follows your logic

 

VianneyM_1-1577657241070.png

 

In this case I decided to treat each phrase as a single word. To avoid wrong results I cleansed the data eliminating punctuation and white spaces. 

 

Let me know if you have any questions

 

Best,

Vianney

Best,
Vianney
Robert31395
7 - Meteor

Thank you for your revised solution. Because it treats it as individual words though, it matches some instances of the individual words where the entire phrase is not present so it is over inclusive. I was able to get a batch macro to work that gives the results I wanted.

VianneyM
Alteryx
Alteryx

that sounds great @Robert31395 

 

Would you mind shearing it with the community for others to learn also

 

Best,

Vianney

Best,
Vianney
Labels