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

Need Formula to Replace abbreviated terms to full term expression

sbb
7 - Meteor

Hello,

 

I have a status code column that contains values for the following values:

ACTIVE

CANCELED

TERMINATED

AC

CA

 

AC and CA stand for ACTIVE and CANCELED respectively.

 

I need a formula to replace the AC and CA to show ACTIVE and CANCELED. I tried the following expression for ACTIVE:

 

Replace([MBRSHP_STS_CD], "AC", "ACTIVE"). I get the right value for AC to appear as ACTIVE, but the ACTIVE values now show as ACTIVETIVE. 

 

Is there a way for me to tell Alteryx to look for only "AC," and not the 'AC' in ACTIVE?

 

Thank you.

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus
Option 1:

Regex_replace([status_code],"^AC$",'ACTIVE')

Option 2:

Use the find and replace tool and match to entire word only. You'll setup a text input tool to read the abbreviation and description from and match AC to Active for replacement.

Option 3:

If length([status_code] == 2 AND [status_code] == "AC" THEN "ACTIVE" elseif
Length .... ca then cancelled else
Ststus_code
Endif

Sorry for the incomplete last option, but my wife needs me now.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Joe_Mako
12 - Quasar

How about:

 

Switch([MBRSHP_STS_CD],[MBRSHP_STS_CD],"AC","ACTIVE","CA","CANCELED")

switch.png

MarqueeCrew
20 - Arcturus
20 - Arcturus
I like that too.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sbb
7 - Meteor

Thank you Marquee.

sbb
7 - Meteor

Thank you Joe! Your solution worked for me.

Labels