The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] Replacing the international code of a telephone number
Kate_Strydom
Member Posts: 19 Contributor II
Hi,
I am battling to replace the first two digits (international code) of a mobile phone number, for example, 27766270940 without RM replacing the other set of 27 within the number.
I need the mobile number to become 0766270940.
Can anyone assist me?
Thanks
Kate
I am battling to replace the first two digits (international code) of a mobile phone number, for example, 27766270940 without RM replacing the other set of 27 within the number.
I need the mobile number to become 0766270940.
Can anyone assist me?
Thanks
Kate
0
Answers
Scott
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
i think you simply forgot a paranthesis. This should work: you can by the way split this into two parts in Generate Attributes. Than it is a bit more readable.
Cheers,
Martin
Dortmund, Germany
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; . It was a great help when you are all alone behind a pc with no other RM person to bounce ideas off.
Regards,
Kate
Dortmund, Germany