Alteryx Designer Desktop Discussions

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

Account number formatting

tiverson
8 - Asteroid

I have account numbers that need to be shortened with certain criteria.  

First, if the full Account is not 8 digits, a zero needs to be added to the account (Adj Account) to make it a full 8 digits.

Second, to create the Short Acct, I need to return a minimum of 3 numbers.  The Short Acct ends before the first zero after a minimum of 3 numbers are returned.

 

Account     Adj Account          Short Acct

1230012        01230012               0123

1300010        01300010               013

20200012      20200012               202

1 REPLY 1
chukleswk
11 - Bolide

You can use the following formulas to generate the desired results:

Adj Account: PadLeft(tostring([Account]), 8, '0')

Short Acct: left([Adj Account],3)

 

Capture.PNG

Labels