community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Keep only Capitals of String

Highlighted

Hi All,


I've been trying to do the following, with no success, for a while now.

 

I have Company Names as a string (i.e Albatross Banana Cookie) in my field Company, I want to go from the full name to an acronym that keep only the capitalised letters (i.e ABC). Any ideas if this is possible?

 

Thanks,

You can do this with a REGEX_Replace in a formula tool something like:

REGEX_Replace([CompanyName],"[^A-Z]","")

This will match and replace everything that isnt a capital letter with an empty string

Alteryx Certified Partner
Alteryx Certified Partner
Regex_replace([name],"[\l\s],'',0)

That will cause all lowercase letters and spaces to be replaced by nothing. Make sure to cleanup business suffixes first (e.g. Inc).

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Alteryx Certified Partner
Alteryx Certified Partner
James,

I like your style. But, you don't have case sensitivity turned on. Is that another reason to define by characters instead?
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.

Good point - wasnt in front of Alteryx and always forget that!

 

REGEX_Replace([CompanyName],"[^A-Z]","",0)

as @MarqueeCrew says need the ,0 to make it case sensitive

 

Labels