We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula to snip data

nicktekippe
8 - Asteroid

I need a formula that will trim the serial numbers that start with UG22 to the following three characters. In the example below the result would go from UG2221511168 to 215

nicktekippe_1-1661270726815.png

 

 

1 REPLY 1
IraWatt
17 - Castor
17 - Castor

Hey @nicktekippe,

Hard to recommend a one size fits all solution to this but one method is to do the following:

 

IF Left([Serial#],4)="UG22" THEN Substring([Serial#],4,3) ELSE [Serial#] ENDIF

 

The formula checks if the text starts with UG22 if it does then starting from the 4th character grab the first 3 characters:

IraWatt_0-1661271003719.png

The community has some quick and easy videos on formulas and the Formula Tool here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Writing%20...

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

Labels
Top Solution Authors