Alteryx Designer Desktop Discussions

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

Whats the best way to replace a group of text in a column with blanks?

zenSMP
7 - Meteor

Hi All,

 

As per title, whats the best way to replace a group of text in column with blank.

 

Example in the attached excel and photo below I would like to replace 3M/Nokia/Cisco in input with Blank and have it shown as output.

 

I understand formula, regex and find a replace may work but am wondering how would you guys write it.

Example the below may work but is it graceful or scalable.

TRIM(
REPLACE(

REPLACE(
REPLACE([Input],'3M','')

,'Nokia','')

,'Cisco',''))

Screenshot 2022-11-22 at 11.33.00 PM.png

11 REPLIES 11
ShankerV
17 - Castor

@zenSMP 

 

Find and Replace is the best upto me where you can add many criteria for find and replace in alteryx easily.

 

Many thanks

Shanker V

 

 

Felipe_Ribeir0
16 - Nebula

Hi @zenSMP 

 

If the words that you want to remove are always the first words of each row, i would use this function (UPDATED*): 

 

replace([input], Getword([input], 0) + ' ', '')

 

Input:

Felipe_Ribeir0_0-1669134149290.png

 

 

Output:

Felipe_Ribeir0_1-1669134168483.png

 

 

 

If they are not and you need to remove specific words, i would use the find replace tool.

 

ShankerV
17 - Castor

@Felipe_Ribeir0 

 

When I used the Getword, it  is fetching only one word.

Am I missing anything.

 

ShankerV_0-1669132323236.png

 

Input:

 

ShankerV_1-1669132342512.png

 

Many thanks

Shanker V

zenSMP
7 - Meteor

Yes, I do understand this is one of the simplest was wondering if there are other methods.

Felipe_Ribeir0
16 - Nebula

Hi @ShankerV 

 

You are right, try this one. The first one that i posted only worked on my machine because my example had only 2 words kkkk:

Felipe_Ribeir0_0-1669132581312.png

 

ShankerV
17 - Castor

@zenSMP 

 

I am mentioning about the find and replace tool, not the formula you have written for replace.

 

ShankerV_0-1669132632037.png

 

Many thanks

Shanker V

 

 

zenSMP
7 - Meteor

Thank you @Felipe_Ribeir0 @ShankerV . Would regex replace work here? why not use that?

zenSMP
7 - Meteor

@ShankerVThank you very much. Yes, I'm aware of the tool find and replace :D

ShankerV
17 - Castor

@zenSMP 

 

This Find and Replace tool is easy too use and you can use it for simple and complex situations too.

 

ShankerV_0-1669132764091.png

 

https://help.alteryx.com/20221/designer/find-replace-tool

 

Many thanks

Shanker V

 

 

Labels