In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Select first part of a string

murrayjl03
7 - Meteor

Hi,

 

I have various strings:

 

TestString1.xls\Test\Documents

Test String 2.xls\Test\Documents

 

I want to select the first part of the string up to the "\".

 

Thanks

4 REPLIES 4
AmeliaG
Alteryx
Alteryx

Thanks for your question!

 

For this I would use a 'Text to Columns' tool with the \ as the delimiter. This will break your string field into two separate fields. The first output field is your desired result.

 

Hope this helps! 

nick_ceneviva
11 - Bolide

You can use the following formula in the formula tool:

SUBSTRING([Field Name],0,FINDSTRING([Field Name],"\"))
AmeliaG
Alteryx
Alteryx

I've attached an example workflow here :)

 

Have a great day!

Kenda
16 - Nebula
16 - Nebula

Hey @murrayjl03! Yet another way to accomplish what you're wanting is to add the following in a Formula tool:

 

REGEX_Replace([Field1], "(.*?)\\.*", "$1")
Labels
Top Solution Authors