Alteryx Designer Desktop Discussions

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

Prioritize Find Replace Function

Ryan-S
5 - Atom

Hi,

 

I am hoping that someone can help me in tailoring a find and replace functionality (See example workflow attached below).  The workflow that I have attached as an example is a simplified example of the issue that I am running into.

 

I have 2 sets of data.  The first is a list of "Description".  The second is a set of "Keyword/Keyphrase" and an associated "Project" for each.  For purposes of the Find Replace function, I want the workflow to look in the "Description" and find a "Keyword/Keyphrase" that is contained in the "Description" and match the "Project" to the associated "Description".  The current workflow does this; however, I am trying to change the prioritization that happens for which "Project" gets matched to each "Description".

 

The current way that the Find Replace function works is that it starts with the first part of the "Description" and sees if there are any matches in any of the "Keyword/Keyphrase".  What I would like it to do instead would be to prioritize the matching of the "Keyword/Keyphrase" based on the position of the "Keyword/Keyphrase" in the second set of data (i.e. prioritize the "Keyword/Keyphrase" that is listed higher up in the data.

 

As an example (to help clarify), data row 9 in the "Description" (Delta Epsilon Zeta) is currently categorized as "Project 4" in the output, presumably since the first work in that "Description" (Delta) matches something in the second set of data; however, I would like that "Description" to be categorized as "Project 5", since the "Project 5" related "Keyword/Keyphrase" ("Epsilon Zeta") shows up higher in the second set of data.  Is there any way to adjust the Find Replace function to do this prioritization (or use a different method of searching the data)?

 

Let me know if it would helpful for me to provide any other clarity.

 

Thanks,
Ryan

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Ryan-S,

 

I added a rankid to the keywords and tokenized both the search and the keywords.  The after performing the find/replace I selected the lowest rankid and joined the data back together.  My result table is:

 

Capture.png

 

If that is a better answer, I've included my workflow.  

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Ryan-S
5 - Atom

Mark,

 

Thank you for your help.  In looking at the workflow that you uploaded, it looks like you are breaking up both the Description and Keyword/Keyphrase into individual words and then doing the find/replace on the individual words and then looking for the match with the lowest RankID.  Is there any way to keep the Keyword/Keyphrase on a full-phrase basis (i.e. do the match of the entire Keyword/Keyphrase in the Description field).  For example, I am looking for the "Epsilon" Description to result in NULL, since there isn't a match for just Epsilon in the Keyword/Keyphrase field. 

 

Thanks,
Ryan

Ryan-S
5 - Atom

Mark,

 

I actually tinkered around a bit more and think that I have a workflow that does what I am looking for - however, it has a few additional steps compared to your example.  Instead of just using the Find Replace to append the RankID and Project Name, I currently having the  the Find Replace do a "Replace Text" with any matched Rank IDs.  I then have to do some additional filtering and joining to get the resulting data that I want.

 

Would you be able to take a look at the attached workflow and let me know if there is anything that I could do to simplify it to make it less cumbersome/complex?

 

Again, I really appreciate your help.

 

Thanks,
Ryan

suli
9 - Comet

Hi @Ryan-S,

 

did you try to sort your lookup table according to the priority?

 

In case of multiple matches F&R will take either last or first value, depending on your matching method.

 

Hope this helps!

Labels