Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

how to validate phone number in a table

i am looking for the code in phone number validation in a table..

9 Replies

Re: how to validate phone number in a table

I think the best way is to validate it in the script using a Regular Expression. See this for an example:

Qlikview Cookbook: Regular Expression Pattern Matching http://qlikviewcookbook.com/recipes/download-info/regular-expression-pattern-matching/

-Rob

http://masterssummit.com

http://robwunderlich.com

Re: how to validate phone number in a table

Could you post examples?

Not applicable

Re: how to validate phone number in a table

sorry robert..i  have no examples..because present i am learning in qlikview.. please  guide me how to write the code..i know isnum function is helpful to my code..but i don't know how to keep that function in my code..

MVP
MVP

Re: how to validate phone number in a table

Hi Venu,

Try like this

Data:

LOAD

*,

If(IsNum(PhoneNumber), 'Valid', 'Invalid') AS IsValidPhoneNumber

FROM DataSource;

Regards,

Jagan.

Not applicable

Re: how to validate phone number in a table

thankyou  very much jagan its working..when i am enter the 11 digits numbers in the fields..the output will be comes in valid..but i want  to display invalid..

jyothish8807
Honored Contributor II

Re: how to validate phone number in a table

Hi Venu,

Try like this:

If(len(PhoneNumber)='10', 'Valid', 'Invalid') AS IsValidPhoneNumber

Regards

KC

Best Regards,
KC
jyothish8807
Honored Contributor II

Re: how to validate phone number in a table

for better validation try this:

If(len(PhoneNumber)='10' and isnum(PhoneNumber), 'Valid', 'Invalid') AS IsValidPhoneNumber

Regards

KC

Best Regards,
KC

Re: how to validate phone number in a table

If that's coming from a system(well or even manually entered I would use:

If(len(trim(PhoneNumber))='10' , 'Valid', 'Invalid') AS IsValidPhoneNumber


MVP
MVP

Re: how to validate phone number in a table

Hi,

Then check this option

Data:

LOAD

*,

If(IsNum(PhoneNumber) AND len(PhoneNumber)='10', 'Valid', 'Invalid') AS IsValidPhoneNumber

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

Community Browser