Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Removing certain words from a string

ksampson
Átomo

I want to remove certain words from a string based on a long list that I have.

 

So example string 

 

Record 1: The road was a long winding and grey. With an yellow wall -

Record 2: The road was a long winding and blue. With an orange wall 

 

Words to pull out 

 

Yellow 

Grey

Orange

Blue 

Purple

 

Result 

 

Record 1: Grey / Yellow

Record 2: Blue / Orange

 

I have tried the append field on the find and replace however it only appends one result from example just grey 

3 RESPUESTAS 3
AngelosPachis
Nebula

Hi @ksampson ,

 

What you can do is use a text to columns tool to split each record to each constituent words. Then maybe you can remove any punctuations (.,-) and then with a Find & Replace tool look up for the values you want to keep

 

It's important to click the Case Insensitive Find button, so yellow can be picked up although you have defined Yellow as the word you are looking for.

 

Screenshot 2021-03-17 085711.jpg

 

Appending the fields to records will then allow you to filter out the nulls and concatenate the matched words together with a summarize tool.

 

 

AngelosPachis_0-1615971412385.png

 

Hope that helps, let me know if you have any questions on the workflow.

 

Regards,

 

Angelos

ksampson
Átomo

 This is great is there any way to do this if there is no space

For example some sentences may look like this

 

Theroadwasalongwindingandgrey.Withanyellowwall 

pedrodrfaria
Púlsar

Hi @ksampson 

 

Using a different logic, with no spaces, I think the best method would be the append fields. See attached for the WF.

pedrodrfaria_0-1615982656726.png

 

pedrodrfaria_0-1615982596404.png

 

Pedro.

Etiquetas