cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help

Former Member
0 Kudos
37

Hi,

I have a mapping requirement as follows-

Need to delete the extention number from telephone number.

The telephone number is comming in the following formats- 414-234-1212 and 414234121 and after this some extention number is comming.Need to truncate it.we can't take length into consideration as we have two formats for telephone number whose lengths differ.Please suggest some UDF that will do this.Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Nagarjuna,

The problem you've stated can be solved without using any UDF's:

You need to use the text function SUBSTRING, CONCAT, CONSTANT and EQUALSS and then the Boolean functions OR, AND and IF-THEN-ELSE.

Inputs to the IF function: (assuming that the input is 414-234-1212 and that the structure of the dashes will not change):

INPUTNUM --> SUBSTRING: 3..4 --> EQUALSS CONSTANT: -

OR

INPUTNUM --> SUBSTRING: 7..8 --> EQUALSS CONSTANT: -

-This checks for dashes on the input number

Inputs to the THEN function:

INPUTNUM --> SUBSTRING: 0..3 --> CONCAT with INPUTNUM --> SUBSTRING: 4..7

Then CONCAT the output from above to INPUTNUM --> SUBSTRING: 8..11

then connect CONCAT to THEN

Input to the ELSE function

INPUTNUM

The program outputs the number without dashes.

Please award points if helpful.

Edited by: dspboys on Aug 15, 2008 9:38 AM

Answers (0)