Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Remove spaces for only certain values within a field

waqaraphoto
7 - Meteor

Looking to remove spaces for only certain values within a field but leave them for others. My goal is to remove all spaces before and after the ">" in the words in the Sector field in the screenshot below (example highlighted yellow). On the contrary I'd also like to retain the spaces for other values within the same field.. (Example underlined red in screenshot)

 

The catch is that the branching structure seen with the ">" are history from website navigation from one menu into its' submenus.. this can change so this solution would need to be rather conformant to infinite possibilities...

 

any ideas on the simplest/ non-redundant way to do this? 

 

Thank you everyone! 

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

@waqaraphoto,

 

Here's a quick RegEx solution:

 

REGEX_Replace([Field1], "\s*>\s*", '>')

This replaces the pattern of 0+ spaces followed by a > followed by 0+ spaces with just the > sign.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
waqaraphoto
7 - Meteor

The Alteryx King has spoken - Mark, your solution was exactly what I was looking for.

 

Thank you! 

W

Labels
Top Solution Authors