Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Help with formula to extract a prefix of a SKU.

ShanMarie_1
6 - Meteoroid
SKUModel CodePrefixPrefix Should Be
MT-QSP6HmO24SRQSP6MT
MT-

AB46446BABSTD

6446

AB
AB4
AB664450BABSTD6445
AB
AB6

 

Alteryx is producing the Prefix column above, but I need it to produce the Prefix column listed in Prefix Should Be above. How can I fix this? Special characters, numbers, and different lengths of text could all be before the Model Code string listed in the SKU. I need everything before the Model Code string in the SKU column to populate the Prefix column so that it matches the Prefix Should Be column.
LEFT([SKU], FINDSTRING([SKU], [Model code]) - 1)

4 REPLIES 4
binuacs
21 - Polaris

@ShanMarie_1 use the left() function

image.png

binuacs
21 - Polaris

@ShanMarie_1 your method

image.png

ShanMarie_1
6 - Meteoroid

The SKU prefix is not always the same length.  It changes but it always comes before Model Code in the SKU string.  Will this method work for prefixes that are 4 or 5 characters?

flying008
15 - Aurora

Hi, @ShanMarie_1 

 

Just try the formula as your need :

LEFT([SKU], FINDSTRING([SKU], [Model Code]) )

 

Labels