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

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels