In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
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

Dynamic Renaming

olehr
8 - Asteroid

Hi there, 

 

In my dataset, I have a bunch of fields that begin with "Avg_"  However, I want to rename them with "constant ". 

 

I have tried the formula: ReplaceChar(regex_replace[_currentfield],"Avg_","Constant")  However, I get Malfunctioned Function Call.  I would appreciate allt he help I can get :)

 

Kind regards

 

 

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @olehr 

 

ReplaceChar function only replaces one char at a time.


Try Replace function

 

Replace([_currentfield],"Avg_","Constant") 

 

Cheers,

olehr
8 - Asteroid

Hi Thableaus, 

 

Thanks, that did the trick :)  

 

However, I forgot to mention that some of the fields fore some reason have this structure

 

Avg_Administrative Area_94,   while others have 

Avg_Service_Area_95

 

How could I at the same time remove the second or third underscore as well ?

 

 

Thableaus
17 - Castor
17 - Castor

@olehr 

 

Replace(Replace([_currentfield],"Avg_","Constant"), "_", " ")

 

This should remove all underscores, replacing them with whitespaces, after you replace "Avg_" by "Constant"

 

Cheers, 

olehr
8 - Asteroid

@Thableaus 

 

Thank you so much. 

 

 

Labels
Top Solution Authors