Free Trial

Alteryx Designer Desktop Discussions

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

Add Space After First 9 Characters

Mike_at_CG
8 - Asteroid

Hi Alteryx Community

 

Wanted to see if there was a way to add a space after the first 9 characters of a string?  

 

Mike_at_CG_0-1667397458107.png

 

So for example the first line item would read 450737911 (SPACE) A000830OO

 

Thank you

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @Mike_at_CG, there's a bunch of ways to go about this but here's one way I can think of:

 

DataNath_0-1667397815468.png

 

The Left() function just takes the first N characters (9 here of course), and then right does the same, except we need this to be dynamic to different record lengths and so we feed it the Length() function and take 9 away from that to account for those on the first side of the space.

Sebastiaandb
12 - Quasar

Hi @Mike_at_CG ,

 

Sure, just make a formula in the formula tool like: 

 

REGEX_Replace([Field1], "(.{9})(.*)", "$1 $2")

Sebastiaandb_0-1667397981338.png

 

 

Greetings,

 

Seb

Luke_C
17 - Castor
17 - Castor

Hi @Mike_at_CG 

 

Here's two options:

Luke_C_0-1667397959832.png

 

 

Labels
Top Solution Authors