Alteryx Designer Desktop Discussions

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

delete a leading 1 in a phone number column

tpostlewate
7 - Meteor

Day 6 with Alteryx, so super newby here.  I have a column in which SOME phone numbers have a leading 1 and some do not. I need to get rid of the leading 1s. Any suggestions?

3 REPLIES 3
AngelosPachis
16 - Nebula

Hi @tpostlewate ,

 

There are many ways to do it. If you want to remove all leading 1, you can use the following formula in a formula tool

 

TrimLeft([Your field with phone numbers],"1")

 

Note that your phone numbers field should be a string for this to work.

 

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

 

Regrds,

 

Angelos 

echuong1
Alteryx Alumni (Retired)

There are a couple of ways to do this, but I think the easiest would be to do a conditional formula with a count. If the length is larger than 10 numbers, you know there is a leading 1. You can then trim the first digit with a right formula.

 

if Length([Field1]) > 10
then right([Field1],10)
else [Field1]
endif

 

echuong1_0-1608747780181.png

 

 

 

tpostlewate
7 - Meteor

Awesome! Thank you guys. I used the formula and there are no leading 1s to be seen! I've been slaving on that all day.

Labels