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.

Find & Replace, but in new column

Samowens30
7 - Meteor

Hi All,

Sorry if this is a basic question, i'm still quite new to the exciting world of alteryx.

I currently have a workflow that cleans up some data. It finds a dirty description and replaces the part of that description with the clean version.

Example:
Dirty: APPLE128GIGXCYRANDOMTEXTEYEPHONE8

Clean: -Apple-128gb-IGXCYRANDOMTEXT-iPhone8-

 

My questions, how can I remove all the random text and insert spaces?

I'd want it to read "Apple 128gb iPhone8"

 

Bare in mind it would need to make multiple changes using the find and replace functionality as it is scanning a long list of possible dirty words to replace with multiple clean words in the same cell.

 

Thanks in advance 🙂  I will of course like / mark solution when I check back later.

3 REPLIES 3
echuong1
Alteryx Alumni (Retired)

You can create a list of values to find, and the corresponding values to replace it with. In the configuration, you can choose to replace multiple instances in the same line. 

 

In the example attached, I replaced any instance of a - with a space.

 

Also, to remove the random text, I recommend using regex to identify the pieces you want and then a formula to put the pieces back together.

 

echuong1_0-1609770692203.png

 

Samowens30
7 - Meteor

Hi,

 

Thank you for this! First part makes sense.

In terms of the Regex, what am I doing here? I couldn't work out what to put in the "Regular Expression" box or the "Output" box.

 

Any guidance would be super appreciated.

Many Thanks,

Sam

echuong1
Alteryx Alumni (Retired)

Are you able to attach a copy of your workflow and specifics?

Labels