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

changing a column

VeronicaElse
8 - Asteroid

Hello

 

I want to write a formula if where a column named state has NHCTX and NHCIL I want the output to only come out as TX and IL only wout the NHC infront of it.

 

can you help plz?

7 REPLIES 7
ChrisTX
15 - Aurora

IF [state] IN ("NHCTX", "NHCIL")

THEN Right([state],2)

ELSE [State]

Endif

 

Here is a list of al functions: https://help.alteryx.com/current/designer/functions

 

Chris

messi007
15 - Aurora
15 - Aurora

@VeronicaElse,

 

Please see below how you can do it:

messi007_0-1616692997497.png

 

Attached the workflow,

If this solve the need please mark it as solved, it will help others,

Regards

VeronicaElse
8 - Asteroid

Thank you for replying -so the state  column will have TX replace NHCTX and IL to replace  NHCIL in the same column in the output?

VeronicaElse
8 - Asteroid

But, I have one column that contains NHCIL and NHCTX and I need them to output on the same column but without the NHC infront of them

ChrisTX
15 - Aurora

are you trying to say... 

 

I have one column that contains NHCIL and a separate column that contains NHCTX  ?

 

Can you provide an Excel file with some sample input data, may 20 rows of data?  And an example of what you the output to look like.

 

Chris

VeronicaElse
8 - Asteroid

No, I have one column named state that has  NHCTX and NHCIL  but I need this same state column to  show in output as TX and IL in the same  column. I need the column to stay the same besides removing the NHC infront of the states.

ChrisTX
15 - Aurora

In the Formula tool, select your existing field name in the drop-down for Select Column.  This will update the value in your existing field.

 

Chris

Labels