Alteryx Designer Desktop Discussions

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

Deleting certain value in a string

GeorgeStone94
5 - Atom

Hello there,

 

I need a little help with the data i'm working with.

 

I need to remove the 9th digit on all records in a text string. The data records in this field is constantly the same length at 12.

 

Currently the data example is:

 

BIGAPPLEXABC

EXTARCHSYJSK

LAUNCHEDFRTO

 

I need Alteryx to remove the bold to then read

 

BIGAPPLEABC

EXTARCHSJSK

LAUNCHEDRTO

 

The letters in bold are random and therefore can't Regex replace on a specific letter and has to be a rule that removes the 9th value. I also need the last 3 letters and therefore can't remove the last 4. Any suggestions would be incredibly helpful.

 

All the best,

George

 

 

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @GeorgeStone94 I mocked up a workflow let me know what you think?

 

Substring_05062020.JPG

GeorgeStone94
5 - Atom

That's got it, thanks!

jeff_reynolds
10 - Fireball

Hi. @JosephSerpis has a formula that works for you needs, but RegEx does work in this cases like this.

 

See attached workflow as an example. I've broken the 12 random letters into three groups. One with 8 characters, one with 1 character, and one with 3. The replacement is simply the first and 3rd group. 

 

I've always found this site to be really useful when trying to build an expression. I cut and past a bit of text I need to work with, build my expression, and once it's working, copy it into Alteryx. I have a hard time wrapping my head around RegEx most of the times, and the site does a great job of showing what the pattern you're writing is doing and why. 

 

https://regex101.com/

 

Good luck. 

Labels