ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

I need to replace multiple fields within the same column

Birdman1971
7 - Meteor

Hi 

 

 I have used the formula tool and can replace any field with e.g the word hello the goodbye 

I use replace (column name) "hello" "goodbye" 

But i also want to replace other words in the same column - such as "wave" to be replaced by "clap"

 

I am stuck as to how and i have tried several options 

 

Thank you in advance 

8 REPLIES 8
jrlindem
12 - Quasar

Within one field, you can simply sequence REPLACE() functions on the same field:

 

jrlindem_0-1762190706125.png

 

You could also nest the REPLACE() functions into itself, but that's more messy.  If you need to do the same replacements across many fields, you can use the Multi-Field Formula, but then you will need to use the nesting approach.

 

Hope that helps, -Jay

Birdman1971
7 - Meteor

Thanks Jay I have tried that option but for whatever reason , maybe as i have other things going on with fields adding together , it only seems to take the last one on the list as it were 

jrlindem
12 - Quasar

@Birdman1971 Can you attach your workflow with some dummy data as an example so I can see what you're experiencing?

Birdman1971
7 - Meteor

Thanks Jay , will have to be tomorrow as i have to head off now - appreciate your help 

Birdman1971
7 - Meteor

HI Jay , looking back i probably wasnt clear with my question. I have a column full of data and i need to change mutiple filelds in the column 

So as an example , the word Deduction will appear 7 times in multiple rows , and i need to change it to insurance. But also in that column , the word Employer appears 15 times in rows , and i need to change that to Director . Thanks again 

Birdman1971
7 - Meteor

I have nested and have got it working ! 

 

dataminex
5 - Atom

Hi Birdman,

You may use Multi-Field Formula tool to do few changes on some columns simultaneously. 

For example, you want to replace any "hello" to "__a__" in columns 'c1', 'c2', and 'c3':
replace(_CurrentField__, "hello", "__a__") and you have to check the columns you wanted.

In addition, by adding another Multi-Field Formula tool you can replace any "goodbye" to "__b__".

Read more in this link:
https://help.alteryx.com/current/en/designer/tools/preparation/multi-field-formula-tool.html#id55508...

 

jrlindem
12 - Quasar

@Birdman1971 Great!  Glad you got it working and that I could help.  Cheers, -Jay

Labels
Top Solution Authors