Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Filling in data from subsequent columns

tleber
5 - Atom

Hey everybody,

I am trying to fill in phone numbers from columns that are on my data set.  Below is what I am starting with:

 

 7042523124 4772273141
643739242579786230612445665089
30390880359389039890 
3504114930 9452965175
221475561645382281363943427809
51341206504636093693 
9098533233 2358304451
   

 

 

I want this data to look like this:

 

70425231244772273141 
643739242579786230612445665089
30390880359389039890 
35041149309452965175 
221475561645382281363943427809
51341206504636093693 
90985332332358304451 

 

What function / expression should I be using?

3 REPLIES 3
Inactive User
Not applicable

Answer attached.

tleber
5 - Atom

Thank you!

 

Are you aware of any tutorials that can help me understand this better?

 

 

Thanks again!

MarqueeCrew
20 - Arcturus
20 - Arcturus

@tleber,

 

I have a simplistic solution for you.  In this solution I make the assumption that there are a limited # of phones and that each phone is exactly 10 digits (this is your example data).  With 700000 input records, this function completes in 1.4 seconds vs 6.0 seconds in @Inactive User's dynamic solution.  

 

capture2.png

 

  • Make sure all input is STRING
  • Trim the data (you had spaces in the field)
  • Formula
    • Concatenate all of the fields into 1 (P1+P2+P3)
    • Parse the phones out of the P1P2P3

Since each phone in the example is 10 digits, we take the leftmost 10 as P1, the second 10 as P2 and the third 10 as P3.

 

If phone #'s don't comply with this standard then the solution won't work as written.  You would need to use the following formula to create the 10 digit phones in P1P2P3:

Padleft([Field1],10," ")+Padleft([Field2],10," ")+Padleft([Field3],10," ")

and then trim all of the output data as you parse it with a TRIM() function like this:

TRIM(Substring([P1P2P3],10,10)

Cheers,

Mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels