Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Format a string of numbers to a phone number format

  1. #1
    Join Date
    Apr 2017
    Posts
    27

    Default Format a string of numbers to a phone number format

    We are importing information data and we get all kinds of values in the phone number field- for example 1234567890, (123) 4567890, 123-456-7890.

    We have used string operations to set the field to digits only. We then want to take the first three numbers and place () around that, then add a space, then after the next three numbers add a dash so the 10 numbers would convert from 12356790 to (123) 456-7890.

    How an we accomplish this (something simple)?

  2. #2
    Join Date
    Nov 2009
    Posts
    688

    Default

    With a scripting step. f.e. the Formula step. Something like: "(" & left([phonenumber];3) & ") " & mid([phonenumber];4;3) & "-" & right([phonenumber];4)

  3. #3
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I would present a phone number like +1 (866) 660-7555 in accordance with ITU recommendation E.123 - storage format would be +18666607555.

    Replace-In-String (using your sample input) could be used to apply the presentation format, too:


    Name:  230488.PNG
Views: 653
Size:  6.0 KB
    So long, and thanks for all the fish.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.