In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. 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

Firm names parse

aparna0208
9 - Comet

Hi,

 

I am trying to compare two columns which has firm names from two different data set. The issue is there are all these different strings at the end as INC, LLC, INC., CO etc. I tried to trim the last part of the string using trim and regex function but it doesn't seem to work. The input and expected output example is given below. Trying to see if there is any better and easy way to do this. Thank you in advance!

 

Input

ABC LLC

XYX INC.,

UIE Advisors, CO.

KJD, LLC.,

 

Output

ABC

XYX

UIE Advisors

KJD

5 REPLIES 5
binu_acs
21 - Polaris

@aparna0208 use the regex formula

Regex_Replace([input], "[,\s]*(LLC|INC|CO)[\.,]*\s*$", "")

binu_acs_0-1765309554112.png

 

jrlindem
12 - Quasar

@binu_acs  regex is a great example of how to do this by stripping off the pieces you don't need.  If you have other suffixes, though you will need to modify the function.

 

For an alternative that doesn't use Regex, give this a peak.  This assumes that you are always just removing off the last portion of the name, regardless of what it is.  The basis of this is Reversing the String, parsing, then reversing back.  Take a look:

 

jrlindem_0-1765310274655.png

 

Hope this helps, -Jay

 

aparna0208
9 - Comet

@binu_acs This did the trick:) Thank you so much! :)

aparna0208
9 - Comet

@jrlindem A new function and method I learnt today. This is awesome:) Thank you so much!

flying008
15 - Aurora

Hi, @aparna0208 

 

FYI.

 

Spoiler
REGEX_Replace(Trim([Input]), '[\s,]+\S*$', '')

录制_2025_12_10_09_21_41_419.gif

 

 

Labels
Top Solution Authors