In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Remove parts of string in field between characters

ZoeM
8 - Asteroid

Hi Team,

I have the below situation where I want to remove <xx> from the string in the field.

I am not too familiar with the Regex Replace formula to perform this for each entry where it exists. 

Any help will be appreciated.

 

Field 1 - IssueField 2 - Intended Result
Franklin, Benjamin (A.) on Monday, February 6, 2023 11:44 PM:
<div class="ExternalClassFE6432E9435F48A49F323E2C9B26EBCD">Body Exterior Structures Closures Approval Status:
Franklin, Benjamin (A.) on Monday, February 6, 2023 11:44 PM:
Body Exterior Structures Closures Approval Status:
Washington, George (R.) on Thursday, March 17, 2022 3:46 AM:
<div class="ExternalClass65B1AA0DB1DD41909F215577703F454D">Customer Service Division Approval Status:
 Pending DV Completion
Washington, George (R.) on Thursday, March 17, 2022 3:46 AM:
Customer Service Division Approval Status:
 Pending DV Completion
Roosevelt, Theodore (A.) on Sunday, May 8, 2022 11:05 PM:
<div class="ExternalClass4855F7409DB449B99E6D09B249E9BC0F">Powertrain Attributes Calibration Approval Status:
 Not RequiredPowertrain Control Systems Approval Status:
Roosevelt, Theodore (A.) on Sunday, May 8, 2022 11:05 PM:
Powertrain Attributes Calibration Approval Status:
 Not RequiredPowertrain Control Systems Approval Status:
5 REPLIES 5
ScottLewis
11 - Bolide

Assuming there are no < or > characters in the string parts of the field you can do this with some old timey string parsing.

 

Formula tool:

 

left ([Field 1 - Issue],FindString([Field 1 - Issue],"<"))
+
right ([Field 1 - Issue], length([Field 1 - Issue])-FindString([Field 1 - Issue],">")-1)

 

 

aatalai
14 - Magnetar

@ZoeM putting this in the formula tool should help.

 

REGEX_Replace([Field1], "<.+>", "")

 

Also attached a workflow for reference 

dwstada
11 - Bolide

@ZoeM this is what you have to do in the Regex tool

 

what it does: find "<" and anything else until it finds ">", then replaces the found string with nothing/empty space

 

ZoeM.PNG

 

ZoeM
8 - Asteroid

While all the responses provided a solution, I had to choose one ðŸ™ˆ

Thank you to all of you for your quick help!

aatalai
14 - Magnetar

@ZoeM you can mark more than one as a solution

Labels
Top Solution Authors