Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic Rename

jlfromm
8 - Asteroid

jlfromm_0-1670433296299.png

My columns look like this and I want to replace all of the _ with a space  what expression in the Dynamic Rename would I use ?

 

4 REPLIES 4
DataNath
17 - Castor
17 - Castor

Hey @jlfromm, you'd want to use the following expression:

 

 

Replace([_CurrentField_],'_',' ')

 

Before:

 

DataNath_0-1670433523493.png

 

After:

 

DataNath_1-1670433536170.png

 

jlfromm
8 - Asteroid

Thank you 

DataNath
17 - Castor
17 - Castor

No problem. Just had a closer look and noticed that some of your fields have duplicate underscores and so the above expression will give you field names like this:

 

DataNath_0-1670433687457.png

 

However, if you use this expression, this will prevent duplicate spaces coming in as the replacement:

 

Regex_Replace([_CurrentField_],'_+',' ')

 

DataNath_1-1670433733338.png

PanPP
Alteryx Alumni (Retired)

You can always use a select tool after the dynamic replace tool to rename columns.

 

In the dynamic replace tool, you have multiple options as well (See below)

 

replacechar([_CurrentField_], " _ ", " ")

REGEX_Replace([_CurrentField_], "\_+", " ")

Regex_Replace([_CurrentField_],'_+',' ')

 

Labels
Top Solution Authors