Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
The Expert Exam is now live online! Read about the specifics and what it took to bring it to life in the blog by our very own Elizabeth Bonnell!
SOLVED

Select first part of a string

Highlighted
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

Highlighted
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! 

Highlighted
Alteryx Certified Partner

You can use the following formula in the formula tool:

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

I've attached an example workflow here 🙂

 

Have a great day!

Highlighted
14 - Magnetar
14 - Magnetar

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