ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Extraction of invoice number from a string column, using matching rules

DE22
7 - Meteor

Hello, 

 

Could you, please help me with the situation below: 

 How can I, extract the invoice number, which starts with S0 and keep only the invoice number - Ex. S0001 00008761. 

I should mention that i can find more invoice numbers, into a line and sometime the invoice number might not respect all the number length.

 

Description
053000EFWERW4T71EUR2 000070006546945071025 CCCFACTURE N S0001 00007360
0430003741GHH004971EUR2 00007000239FH4507102500071025FACTURE N S00SHHTG 00000000 000000023673HHTRF2YUU02697
0530003741004971EUR2 005YHY023945281025 CCC1902499959 PAGO DE FACTURA N S0001-00008559
0530003741004971EUR2 0J63700023945271025 CCC1902499900 PAAA FACTURA N S0001 00008761
0430003741004971EUR2 000070002359G14082500140825RGLT FACT S00SHYHH OTTT B 00000000 0000000049493DTRF00999108
0430003741004971EUR2 0000700023193H6032500170325S0001-0000596APPPP SHIPPING 4 00000000 0000000396404ES06539319B8401
2 REPLIES 2
jrlindem
12 - Quasar

Regex will be your friend for this, but there is inconsistency in your pattern example.  If you are literally looking for "S####_########" then the following works:

 

jrlindem_2-1763144714422.png

 

 

 

But as you can see that does not help with situations like:

 

jrlindem_3-1763144732396.png

 

 

So if you can use Regex to identify the pattern, you should be able to adapt it.  If you need further help.  Can you provide the expected output from each line and myself or others can further help.  -Jay

DE22
7 - Meteor

Thanks a lot! :)

Labels
Top Solution Authors