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

Regex Replace for many values at once

Asteroid

I have a number of REGEX replace functions I need to do to my data before I can work with it (and parse a particular field). It ended up with a bunch if individual formula sections for the same field. I thought perhaps all of them could be put into one formula with OR separating them but that is resulting in a 0 result

 

Is there a way to do all of these in one function? Or does it have to be individual formulas?  Can it be done with a mapping file of the before and after text? Just looking for an easier way. 

 

 

REGEX_Replace([Groups_Copy], ' - Self Assessment tool - ', '_Self Assessment tool_') OR
REGEX_Replace([Groups_Copy], 'Privacy Compliance Survey - HCC&P Hierarchy', 'Privacy Compliance Survey_HCC&P Hierarchy') OR
REGEX_Replace([Groups_Copy], ' - Consumer Business', '_Consumer Business') OR
REGEX_Replace([Groups_Copy], ' - Regional Office', '_Regional Office') OR
REGEX_Replace([Groups_Copy], 'GCO - R&D', 'GCO_R&D') OR
REGEX_Replace([Groups_Copy], 'Compliance Scan - Intl-Privacy -HCC&P Hierarchy', 'Compliance Scan_Intl_Privacy_HCC&P Hierarchy') OR
REGEX_Replace([Groups_Copy], 'HCC&P Hierarchy - Self Assessment tool- ', 'HCC&P Hierarchy_Self Assessment tool_') OR
REGEX_Replace([Groups_Copy], 'HCC-HCBI - HCC&P Hierarchy', 'HCC_HCBI_HCC&P Hierarchy') OR
REGEX_Replace([Groups_Copy], 'HCBI - HCC&P', 'HCBI_HCC&P') OR
REGEX_Replace([Groups_Copy], 'Privacy - HCC&P', 'Privacy_HCC&P') OR
REGEX_Replace([Groups_Copy], 'Commercial Pharm - ', 'Commercial Pharm_') OR
REGEX_Replace([Groups_Copy], ' - GFO - ', ' _GFO - ') OR
REGEX_Replace([Groups_Copy], '- CS', '_CS') OR
REGEX_Replace([Groups_Copy], '- GS', '_GS') OR
REGEX_Replace([Groups_Copy], '- CIS Countries - ', '_CIS Countries_') OR
REGEX_Replace([Groups_Copy], ' - Franchise groups', '-Franchise groups') OR
REGEX_Replace([Groups_Copy], 'GCC - HCC&P', 'GCC-HCC&P') OR
REGEX_Replace([Groups_Copy], 'JGS USA - Janssen Global Services', 'JGS USA-Janssen Global Services') OR
REGEX_Replace([Groups_Copy], 'Care - Central', 'Care-Central') OR
REGEX_Replace([Groups_Copy], ' - Caribbean Island', '-Caribbean Island') OR
REGEX_Replace([Groups_Copy], 'Russian Federation -CIS Countries', 'Russian Federation-CIS Countries') OR
REGEX_Replace([Groups_Copy], 'Cranio-Maxillofacial', 'Cranio/Maxillofacial')

Alteryx Certified Partner
Alteryx Certified Partner

Have you considered using the FIND REPLACE tool?

 

https://help.alteryx.com/11.0/index.htm#FindReplace.htm?Highlight=find replace

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

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