Free Trial

Alteryx Designer Desktop Discussions

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

Formatting

Feras95p
8 - Asteroid

Dear all,

 

I have a list of phone numbers, most of them are started with 0 and the other started with the number directly without 0. For example 0547584778 or 547584778 I want the numbers which are not not started with 0 to add the 0 at the beginning. How is it possible?  

2 REPLIES 2
AngelosPachis
16 - Nebula

Hi @Feras95p ,

 

You can convert your phone numbers to a string data type and then use a formula tool with the function Padleft.

 

What this will allow you to do is define the total length of that string (in our occasion that is 10) and the formula will add 0s to the left hand side until the length of that string becomes 10.

 

So if the input to the tool is this

 

AngelosPachis_0-1613032605734.png

the output would be

 

AngelosPachis_1-1613032618796.png

Hope that helps, let me know if that worked for you.

 

Cheers,

 

Angelos

AntDavis42
7 - Meteor

Hi @Feras95p ,

 

Here is an example that will only add the 0 if the number is 9 digits long and unions the already correct numbers to the filtered options.

AntDavis42_0-1613034530027.png

 

Labels
Top Solution Authors