Whats the best way to replace a group of text in a column with blanks?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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',''))
- Labels:
- Datasets
- Expression
- Python
- Regex
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
Output:
If they are not and you need to remove specific words, i would use the find replace tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
When I used the Getword, it is fetching only one word.
Am I missing anything.
Input:
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, I do understand this is one of the simplest was wondering if there are other methods.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am mentioning about the find and replace tool, not the formula you have written for replace.
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @Felipe_Ribeir0 @ShankerV . Would regex replace work here? why not use that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@ShankerVThank you very much. Yes, I'm aware of the tool find and replace :D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This Find and Replace tool is easy too use and you can use it for simple and complex situations too.
https://help.alteryx.com/20221/designer/find-replace-tool
Many thanks
Shanker V
