Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start 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
18 - Pollux
18 - Pollux

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
18 - Pollux
18 - Pollux

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