The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

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
Top Solution Authors