[SOLVED] Replacing the international code of a telephone number
Find more posts tagged with
Sort by:
1 - 5 of
51
Thanks Scott. Your approach works well. 
My attribute is already nominal. I was trying to use a start and replace function but they were not working very well.
Now I have some mobile numbers that need to be excluded or replaced as missing, once I have applied your approach. Basically I need to exclude any number with 00 or 01.
This expression if(prefix(mobile_number, "00"), " ", if( prefix(mobile_number, "01"), " ", mobile_number) is giving me errors.
Any suggestions?
Kate

My attribute is already nominal. I was trying to use a start and replace function but they were not working very well.
Now I have some mobile numbers that need to be excluded or replaced as missing, once I have applied your approach. Basically I need to exclude any number with 00 or 01.
This expression if(prefix(mobile_number, "00"), " ", if( prefix(mobile_number, "01"), " ", mobile_number) is giving me errors.
Any suggestions?
Kate
Hi Martin,
My error when typing out the function. Sorry
.
When I was driving home last night I realised that the prefix function is the problem. I cannot use a prefix to identify the 00 and 01 as this function will keep the first two digits. I want it to identify the first two digits and then exclude the ones that are not valid.
Got it. Now Scott's approach works perfectly for me.
. It was a great help when you are all alone behind a pc with no other RM person to bounce ideas off.
Regards,
Kate
My error when typing out the function. Sorry

When I was driving home last night I realised that the prefix function is the problem. I cannot use a prefix to identify the 00 and 01 as this function will keep the first two digits. I want it to identify the first two digits and then exclude the ones that are not valid.
Got it. Now Scott's approach works perfectly for me.
Thanks Scott and Martin for your contribution;
if(starts(mobile_number, "00") || starts(mobile_number, "01") || starts(mobile_number, "02") || starts(mobile_number, "04"), " ", mobile_number)

Regards,
Kate
Scott