Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
CeeJay
Contributor II
Contributor II

Phone Numbers cleaning with condition

Hi everyone,

got a column with phone numbers and used the following

       KeepChar(Replace(Phone, 'O', '0'), '0123456789') AS %KEY_Phone_Bill

to remove special characters

But I would also like to clean the country code, which is part of some but not all entries. This looks like this:

0049170123456

49170123456

490170123456

0170123456

170123456

The only correct way I would like to keep is 0170123456

So I thought I check if the number begins with 00 oder 490 and replace them with 0. Could I use the replace() with $ or something that indicated I want only replace at the beginning of the string. Or do I need to use regex?

2nd step I would check if any string does not start with a 0, so place a 0 in front of the string.

Or is there an easier way to do this?

 
Labels (2)
1 Reply
BrunPierre
Partner - Master II
Partner - Master II

Would you mind explaining your question again?