Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Validity of a phone number

Hi

I have a members table with a column for cell phone numbers, and I need to output members with cell phone numbers that are invalid (less/more than 10 digits).

Can anyone suggest the best way of doing this?

I thought about using mapping as an indicator of which cell numbers are valid and which aren't but I am battling with creating an IF statement for how many digits the cell number is.

Would appreciate any help!

Thanks so much

1 Solution

Accepted Solutions
Not applicable
Author

suggest the len() function

You can either perform

If(len(cellphione) <> 10, 'Invalid,cellphone)

or

if (len(cell phone = 10, cellphone,invalid)

just a matter of do you want to interrogate for a good or bad - the results will be the same

View solution in original post

5 Replies
m_woolf
Master II
Master II

You can use keepchar to create a new field with only digits:

keepchar ( Phone,'0123456789' ) as PhoneDigits;


Then look at len(PhoneDigits):

if(len(PhoneDigits)<>10,"Invalid','Valid') as PhoneValid;

Not applicable
Author

suggest the len() function

You can either perform

If(len(cellphione) <> 10, 'Invalid,cellphone)

or

if (len(cell phone = 10, cellphone,invalid)

just a matter of do you want to interrogate for a good or bad - the results will be the same

sasiparupudi1
Master III
Master III

please provide sample data

sasiparupudi1
Master III
Master III

You could use the if condition as below

if(len(trim(PhoneNo))=10,'Yes','No') as IsPhoneNoValid;

MarcoWedel

Hi,

you could also use regular expressions for this task.

Here are some links on using RegEx in QlikView:

Maybe also helpful for recognizing "outliers" of the phone number patterns:

Re: Please help me get the string pattern of each field.

please try to avoid multiple threads for the same question:

Validaty of Phone Number

hope this helps

regards

Marco