Alteryx Designer Desktop Discussions

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

Formula Removing Leading Zeros

Adam_B
8 - Asteroid

Hello, 

 

I have a column that Alteryx is adding in leading zeros, this field, when opened in excel, does not have the zeros, I'm sure there's an explaination why Alteryx is adding zeros.  However, my question is regarding the formula I am using to remove said zeros.  It's not working and I don't know why, I have added brackets and parenthesis where appropriate. 

 

Below are examples of the formula I am using and an example of the data. 

 

Please help. 

 

Adam_B_0-1680722631967.png

Adam_B_1-1680722814976.png

 

 

6 REPLIES 6
ShankerV
17 - Castor

Hi @Adam_B 

 

It is due to the datatype issue.

Trimleft will work on String types, but the column you are using in Integer type.

 

To overcome the issue, use the below formula

Tonumber(Trimleft(tostring([column name]),"0"))

 

Many thanks

Shanker V

Adam_B
8 - Asteroid

I changed it to an integer and it still gives me the error. 

Adam_B_0-1680723313303.png

 

ShankerV
17 - Castor

Hi @Adam_B 

 

Please use the below formula.

 

Tonumber(Trimleft(tostring([Field1]),"0"))

 

ShankerV_0-1680723428719.png

 

Many thanks

Shanker V

Adam_B
8 - Asteroid

@ShankerV  Still not working

Adam_B_0-1680723633965.png

 

ShankerV
17 - Castor

Hi @Adam_B 

 

Got your issue, this is because of the column name.

 

Trimleft([[REQ] Supplier (Common Supplier ID)],"0")

 

The column name contains the [].

 

ShankerV_0-1680724244405.png

 

Have tried the column name without [], then the formula works fine.

ShankerV_0-1680724375536.png

 

 

Many thanks

Shanker V

 

Adam_B
8 - Asteroid

@ShankerV Thank you!

Labels