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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Phone Number Formatting Question

I'm importing phone numbers that have no standard formating.  Some have (XXX), some have +999, some have "-", etc.  I found the purgeChr() function, which helps immensely.  However, many of the numbers have extensions, such as....

1234567890ext999 or

1234567890x444

Is it possible to remove everything after (and including) the "e" or the "x" in the examples above?

Thanks,    Dan

12 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Did you tried the solution I provided earlier using KeepChar()? 

LOAD

*,

KeepChar(PhoneNumber, '1234567890exEX') AS PhoneNumber_Formatted

FROM DataSource;

Regards,

Jagan.

Not applicable
Author

Yes, KeepChar is a lot simpler naming a dozen nums/chars to keep rather than all those to purge.  Thanks!

jagan
Partner - Champion III
Partner - Champion III

Hi Dan,

If you got the answer you can close this thread by marking Correct and Useful answers to the posts which helps you in finding the solution.

Regards,

Jagan.