2022.1.1.30569 Patch Release Update

The 2022.1.1.30569 Patch/Minor release has been removed from the Download Portal due to a missing signature in some of the included files. This causes the files to not be recognized as valid files provided by Alteryx and might trigger warning messages by some 3rd party programs. If you installed the 2022.1.1.30569 release, we recommend that you reinstall the patch.

Alteryx Designer Discussions

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

Add a "0" to the Beginning of String

RifferX
8 - Asteroid

Hello -- I have NCPDP numbers where some begin with 0 and are 7 characters. I want to change the data after the fact (takes me over 6 hours to run this script) to include the 0 in front when it gets removed and the NCPDP is only 6 numbers in a string. In excel, this is a simple formula of =TEXT([@NCPDP],"0000000"). So, the output will always be 7 characters but where there is a 0, it will be included instead of blank and the string only being 6 characters. I need to join this later to other strings that already include the 0. So an NCPDP # of 430495 should read 0430495 as a string.

 

I can't figure out how to do this in Alteryx using the Formula tool. I do not want to have to rerun this script again and add the Select tool to change to string before it is saved to yxdb file. I have over 14 million rows. Any help is appreciated.

 

--Russ

2 REPLIES 2
MarqueeCrew
19 - Altair
19 - Altair

Hey @RifferX ,

 

No problems.  Try this solution:

 

PadLeft([@NCPDP],7,"0")

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
RifferX
8 - Asteroid

@MarqueeCrew Thanks sir. I actually just figured it out myself.

Labels