Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Limit number of characters in cell

skeen503979
8 - Asteroid

Hello,

 

I want to eliminate some leading zeros at the beginning of a string of numbers.  Each list should only contain 15 numbers (the first of which might be a zero).  How can I eliminate the leading zeros so that all that remains are the 15 characters?  I'm guessing there are a few ways to accomplish this.

Thoughts?

 

skeen503979_0-1614018288368.png

 

3 REPLIES 3
AngelosPachis
16 - Nebula

Hi @skeen503979 ,

 

One way would be to first of all trim all leading zeros from the left hand side of the numbers. Then you can pad it on the left with zeros, until you get 15 digits in total

 

AngelosPachis_0-1614019654269.png

 

You can do it in a single expression as well 

 

 

PadLeft(TrimLeft([Input],"0"), 15, "0")

 

 

Hope that helps,

 

Angelos

 

skeen503979
8 - Asteroid

Thanks, @AngelosPachis .  That helped.  I still have data that isn't linking with my Join tool, but I'll keep at it to figure out why.

AngelosPachis
16 - Nebula

@skeen503979 Maybe the length of some string records exceed the 15 characters limit?

 

Keep working on it and compare what falls out of the R and L output anchors if you are using a regular join tool, that should help you figure this out

Labels