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

Removing product code and sku after a product name

hudg16
7 - Meteor

Capture.PNG

 I'd like to remove the model code , MHCQ3VC/A and the sku 104813 - How can I go about this?

Spacing is not always consistent, but they always come at the end of the string. 

10 REPLIES 10
apathetichell
19 - Altair

regex_replace([description],"(.*)(\w{7}.*)","$1") should work.

 

This assume that the product code contains the first unbroken string of 7 alphanumeric characters in a row.

hudg16
7 - Meteor

This appears to nuke me if I have Samsung, I've made it just apple. 

Second, if I only have a sku how should I go about it, tone down to 6? -- this is a samsung only thing 

SAMSUNG GALAXY A51 64GB BLACK 105161

apathetichell
19 - Altair

Hi!

 

I'll shoot you over a workflow in a second - but it might be easier to break everything down and then reconfigure it if you don't have a standard break for description. obviously for SKU we can extract as it's a number set (\d+) which trails.

apathetichell
19 - Altair

this one may be more scalable - if you want to pull the SKU/description let me know.

hudg16
7 - Meteor

That worked so well I cannot believe it - thank you. 

It could be useful to pull a model type. I will fix the IPHONE11 no space issue, and remove SAMSUNG, as a prefix but still fail to see how I'd drop out the model. Would a text to column work? No need for the storage size, nor colours. 


HUAWEI P20 128GB
HUAWEI P20 PRO
SONIM XP8
IPHONE XS 512GOLD
IPHONE XS 512SLVR
IPHONE XR 64 BLK
IPHONE XR 64 BLUE
IPHONE XR 64
IPHONE XR 64 RED
IPHONE XR 64 WHT
IPHONE XR 128 WHT
HUAWEI P30 128GB BLUE
SAMSUNG A70 128GB
IPHONE 11 64GB BLK
IPHONE11 64GB GRN
IPHONE 11 64GB PR
IPHONE 11 64GB RD
IPHONE 11 64GB WH
IPHONE 11 64GB YL
IPHONE11 128GB BLK
IPHONE11 128GB GRN
IPHONE 11 128GB PR
IPHONE 11 128GB RD
IPHONE 11 128GB WH
IPHONE11 256GB BLK
SAMSUNG GALAXY S20 5G GREY
SAMSUNG GALAXY S20+ 5G BLK
SAMSUNG GALAXY A51 64GB
SAMSUNG GALAXY A71
LG G8X THINQ SS
LG K61 128GB
HUAWEI P40 PRO
MOTO E 32GB BLUE
LG VELVET 128GB GREY
LG VELVET 128GB
SAMSUNG NOTE20 ULTRA 5G BLK
SAMSUNG NOTE20 ULTRA 5G BRZ
SAMSUNG GALAXY A21 32GB
LG K31 32GB
SAMSUNG GALAXY S20 FE
SAMSUNG GALAXY S20 FE
SAMSUNG GALAXY S20 FE NAVY
SAMSUNG GALAXY S20 FE
SAMSUNG GALAXY S20 FE RED
SAMSUNG GALAXY S20 FE
IPHONE 12MINI 64 BK
IPHONE 12MINI 64 BL
IPHONE 12MINI 64 GN
IPHONE 12MINI 64 RD
IPHONE 12MINI 64 WH
IPHONE 12MINI 128BK
IPHONE 12MINI 128BL
IPHONE 12MINI 128GN
IPHONE 12 64 BK
IPHONE 12 64 BL
IPHONE 12 64 GN
IPHONE 12 64 RD
IPHONE 12 64 WH
IPHONE 12 128 BK
IPHONE 12 128 BL
IPHONE 12 128 GN
IPHONE 12 128 RD
IPHONE 12 128 WH
IPHONE 12 256 BK
IPHONE 12 256 BL
IPHONE 12 256 GN
IPHONE 12 256 RD
IPHONE 12PRO 128BL
IPHONE 12PRO 128GD
IPHONE 12PRO 128GT
IPHONE 12PRO 128SL
IPHONE 12PRO 256BL
IPHONE 12PRO 256GD
IPHONE 12PRO 256GT
IPHONE 12PRO 512BL
IPHONE 12PRMX 128GD
IPHONE 12PRMX 128SL
IPHONE 12PRMX 256BL
IPHONE 12PRMX 256GD
IPHONE 12PRMX 256GT
IPHONE 12PRMX 512BL
SAMSUNG S21 128GB GREY
SAMSUNG S21 128GB
SAMSUNG S21+ 128GB
SAMSUNG S21+ 128GB
SAMSUNG S21 ULTRA
SAMSUNG S21 ULTRA
LG K32 32GB GREY
SAMSUNG A32 64GB
SAMSUNG S21 256GB GREY
SAMSUNG S21 PLUS
SAMSUNG S21 ULTRA
TCL 20 PRO 5G GREY
SAMSUNG A52 128GB

apathetichell
19 - Altair

It starts getting pretty complicated because of the fairly unique syntax each phone company uses. I can get you half-way there but it'll require substantial work to finish off what you need for brand/color info.

hudg16
7 - Meteor

I revised to 

regex parse (\w+\s+\w+)

gives me "Samsung S21" and should suffice with some renaming of some phones with weird naming. Thanks for your help. 

 

davidlan
5 - Atom

Thank you, i have the same problem like this

apathetichell
19 - Altair

@davidlan - can you post a data sample (either here or in a new thread)?

Labels