Alteryx Designer Desktop Discussions

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

Rename Multiple Columns in Different Locations

shaheer
8 - Asteroid

I have a table with header names

 

x1x2Ax4x5BCx8

 

I want to rename A, B and C to Happy, Sad, and Lucky, just as an example. I have tried using formulas with dynamic rename but none of it is recognized/syntax is incorrect:

 

IF [_CurrentField_]=="A" THEN [_CurrentField_]=="Happy" ELSEIF [_CurrentField_]=="B" THEN [_CurrentField_]=="Sad" ... etc

 

I tired using a right input data file, but that overwrites the first three column headers only and doesn't let me specify the column names I want it to change.

2 REPLIES 2
Felipe_Ribeir0
16 - Nebula

Hi @shaheer 

 

The correct way to use this formula is like this:

 

IF [_CurrentField_]=="A" THEN "Happy" ELSEIF [_CurrentField_]=="B" THEN "Sad" ELSE "Other" ENDIF

 

Felipe_Ribeir0_0-1665779844839.png

 

acarter881
12 - Quasar

Here's how I would do it (see spoiler). Also, please note that double equals is the exact same as a single equals in Alteryx.

Spoiler
acarter881_0-1665780253839.png

 

Labels