Alteryx Designer Desktop Discussions

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

Formula to match format in column with multiple formats and replace with specific portion.

BethA
5 - Atom

Original column has content with multiple alpha numerical formats. I want to create a new column that finds the invoices with the specific format 0######-# and for those only, drop the leading 0, and also the -# at the end.   All other invoices should be the same.

I did it as a 2 step formula tool in the attached flow.  The first formula drops the leading 0 for the 0######-# formats. 

The 2nd formula finds the format ######-# and should return only the first 6 digits.  It works for some but not others. I don't know why this isn't working for all of the target formatted items in the 2nd formula.  I also did a cleanse tool to try to clear out any extra info, but it doesn't seem to make a difference.

What is the correct format for the 2nd formula so all matched formats will return only the left 6 digits?

Below are two samples of the original and output column.  Why do some of the revised invoices retain the -# ending and others are correct and just the 6 digits? 

 

Your help is much appreciated.  Thank you in advance!

BethA_0-1643429452283.png

BethA_1-1643429544430.png

 

 

6 REPLIES 6
BethA
5 - Atom

First formula

BethA_0-1643429869684.png

 

2nd formula

BethA_1-1643429909557.png

 

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @BethA 

 

I am guessing you have found the solution. Please mark your post as accept solution so that we know this question is already solved.

 

Happy to help : )

Cheers and have a nice day!

BethA
5 - Atom

I still need help. The formulas are from me, they are the ones not working.  Thanks.

atcodedog05
22 - Nova
22 - Nova

Hi @BethA 

 

Try this formula. It seems to work.

 

atcodedog05_1-1643654639798.png

 

Hope this helps : )

 

BethA
5 - Atom

Thank you!  

Akash__on
8 - Asteroid

I loved this solution 😊

Labels