Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

TRIM THE DIGITS INTO ONE

dunkindonut7777
8 - Asteroid

Hi I have a data here that I want to trim down the leading zeros in the left side:

 

Code:        Expected Code:

000              0

002              2

023              23

016              16

 

Can you help meout with this one pls?

3 REPLIES 3
Chantelb
9 - Comet

Hi @dunkindonut7777 ,

 

You can use Trimleft and Regexmatch for when it is all zeros:

 

Chantelb_0-1634619992784.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

You can use ToNumber([Code:]) to trim all not-required zeros.

 

Workflow:

atcodedog05_0-1634625562373.png

 

Hope this helps : )

 

vsoni
Alteryx
Alteryx

this article goes through this:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Remove-Leading-Zeros-From-a-...

 

TL;DR: use TrimLeft to remove '0' from the left of your fields.

 

Labels