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

Alteryx Designer Desktop Discussions

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

Dynamic rename

LuckyRaju
7 - Meteor

I want to rename the field names dynamically like below

 

if filed name contains "Date"  , rename it to "Reg Date"

 

if filed name contains "Employee Name"  , rename it to "Employee Name"

 

if filed name contains "Employee ID"  , rename it to "Employee ID"

 

Original Field NamesFiled Names to be Renamed
Addl Reg DateReg Date
Addl Employee NameEmployee Name
Reg Employee IDEmployee ID
5 REPLIES 5
caltang
17 - Castor
17 - Castor

[A] = Original Field Names


IF CONTAINS([A], “Date”)

THEN “Reg Date”

ELSEIF CONTAINS([A], “Employee Name”) 

THEN “Employee Name”

ELSE “Employee ID”

ENDIF

 

Extend the condition as you see if. The Dynamic Rename tool can be used with the Formula option selected, and the Field Name double clicked.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
ShankerV
17 - Castor

Hi @LuckyRaju 

 

One way of doing this.

 

ShankerV_0-1687240383445.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @LuckyRaju 

 

Step 1: Input

 

ShankerV_0-1687240441690.png

 

 

Step 2: 

 

ShankerV_1-1687240460725.png

IF contains([_CurrentField_],"Date")
THEN "Reg Date"
ELSEIF contains([_CurrentField_],"Employee Name")
THEN "Employee Name"
ELSEIF contains([_CurrentField_],"Employee ID")
THEN "Employee ID"
ELSE [_CurrentField_]
ENDIF

 

ShankerV_2-1687240478877.png

 

 

Many thanks

Shanker V

 

binuacs
21 - Polaris

@LuckyRaju If your column names are following the same pattern you can use the below regex function

binuacs_0-1687240986762.png

 

flying008
15 - Aurora

Hi, @LuckyRaju 

 

Maybe you can use Dynamic-Rename tool with formula:

 

 

 

 

Trim(Right([_CurrentField_], Length([_CurrentField_]) - FindString([_CurrentField_], '')))

 

 

Labels