community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Dynamic Renaming

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

 

 

Alteryx Certified Partner
Alteryx Certified Partner

Hi @olehr 

 

ReplaceChar function only replaces one char at a time.


Try Replace function

 

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

 

Cheers,

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 ?

 

 

Alteryx Certified Partner
Alteryx Certified Partner

@olehr 

 

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

 

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

 

Cheers, 

Asteroid

@Thableaus 

 

Thank you so much. 

 

 

Labels