Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

TrimRight Function

Highlighted
8 - Asteroid

I thought TrimRight([Field1],"-") would work but no luck. Any help would be great!

 

 

Field 1Desired Output
4645-48644645
13232-789713232

465413-6548678

465413
5613212156-561654655613212156
3213-564653213
Highlighted
Alteryx
Alteryx

Hey @garretwalters12 ,

 

There may be many ways to solve this, however, the one that I came up with utilizes the Regex tool. See attached photo configuration. 

 

If you are new to Regex I would highly recommend checking out our tool mastery article on it here.  

 

Capture.PNG

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hello @garretwalters12,

 

Use this formula:  (.+)-(.+)

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @garretwalters12 ,

 

you could try the formula:

 

Right([Field 1], Length([Field 1]) - FindString([Field 1], '-') - 1)

 

It should cut the string right to "-".  Hope this is helpful.

 

Best,

 

Roland   

Highlighted
11 - Bolide

All of the above are great solutions. For those that aren't as comfortable with RegEx or with formulas the Text to Columns tool also works nicely. If you delimit on the '-' character it will create two new columns, one with everything before the dash and one with everything after.

 

kayers_0-1580328366219.png

Labels