Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Column rename

mihir_mir_jb
8 - Asteroid

Hi,

 

If in a given column lets say I want to rename a particular group of events how can I do that by creating a new column.

 

For eg :- In a given column I have FETA-FETA as one grouping and need to rename it as Liquidity in a new column, how can I do that.

 

Thanks for your help.

6 REPLIES 6
echuong1
Alteryx Alumni (Retired)

If I understand your question correctly, you would use a conditional statement in a formula tool. 

 

In the output field, create a new column by selecting "Add Column" and then typing in the new column name. 

 

In the expression window, you would use a conditional statement like the below:

if [FIELD] = 'FETA-FETA' 

then 'Liquidity'

else [FIELD]

endif

mihir_mir_jb
8 - Asteroid

Thank you for replying.

 

I have used the below conditional statement

 

if [Transfer Agency] ="FETA-FETA" then "Liquidity"  else "blank" endif

 

however I am getting all blank in the new column

echuong1
Alteryx Alumni (Retired)

The Transfer Agency field would have to have exactly 'FETA-FETA' in it for it to return Liquidity. 

 

Try using a contains statement instead. Are you able to post a sample of your data?

 

if contains([Transfer Agency], "FETA-FETA") then "Liquidity"  else "blank" endif

mihir_mir_jb
8 - Asteroid

Thank you vm for your help, the conditional statement.

 

Now the issue that I am facing is that if I use conditional statement and contain statement in for the same field, the previous condition becomes blank.

 

Consider this,

 

First I am using

if [Transfer Agency] ='FETA - FETA' then'Liquidity' else 'blank' endif    - For this I am getting the desired result.

 

After this I am using

if contains([Business], "Institutional") then "Institutional" else "blank" endif   - while doing this the FETA-FETA becomes blank as well.

 

How can I avoid this.

 

 

mihir_mir_jb
8 - Asteroid

Hi,

 

Can you please help on my query.

echuong1
Alteryx Alumni (Retired)

Nest all conditions into the same formula tool. Instead of using the IF x THEN y ELSE z ENDIF syntax, you would use the ELSEIF syntax. 

 

The reason why FTEA-FETA is blank is because the column is using the last set of rules. 

 

if [Transfer Agency] ='FETA - FETA' then 'Liquidity'

elseif contains([Business], "Institutional") then "Institutional"

else "blank" endif 

Labels