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.

String truncation

Nandakishore
8 - Asteroid

Hi ,

 

I have this requirement to return the sting as per the logic below . 

 

String : 001812409895 LIJST       00010     4509621376

 

Expected Output : return the string from left untill a ' ' is found i.e : 001812409895 but it gives me : 001812409895 LI

 

Thanks

3 REPLIES 3
alexnajm
17 - Castor
17 - Castor

We need more information - what is the function you are currently doing? Is your data type the correct size? This is assuming you are using a Formula tool

alexnajm
17 - Castor
17 - Castor

The Text to Columns tool would also work here: 

cjaneczko
13 - Pulsar

@Nandakishore you can use the following in a formula tool, where Field1 is your string. 

 

 

REGEX_Replace([Field1], '(^\d+)(\s.+)', '$1')

 

 

If the first set of the string can contain Letters, you can update the formula with the following.

 

REGEX_Replace([Field1], '(^[a-zA-Z0-9]+)(\s.+)', '$1')
Labels
Top Solution Authors