Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

email id verification using set analysis

Hi

I have a list of emailid s, of which some are fake.

How can I count the number of correct ids using set analysis.

What filters I can use in the expressions to draw a chart?

Can you please help me?

6 Replies
sfatoux72
Partner - Specialist
Partner - Specialist

Try something like that :

Count({$<email={"*@*.*"}>} email)

What condition the email need to respect for you?

Not applicable
Author

Can you please tell phone number validation expression for set analysis also...

Not applicable
Author

In java there is a generic statement like

JavaScript code to validate an email id

  1. function ValidateEmail(mail)
  2. if (/^\w+([\.-]?\ w+)*@\w+([\.-]?\ w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value))

I want to have a similar generic pattern in Qlikview, so that any kind of email can be validated comparing with the above similar pattern.

sfatoux72
Partner - Specialist
Partner - Specialist

Hi Kalyani,

In summary, the links provided by Marco say that :

  • Regular expression don't exist in Qlik
  • Is it possible to create specifics functions with macro and use it in load script

This is a good solution in QlikView, but Macro don't exist in Qlik Sense.

if you want to use your test in QlikView and in Qlik Sense, you must break down your regular expression in several small  test, like :

  • The email have a local part and a domain part separated by a @
    • SubStringCount(email, '@') = 1
    • SubStringCount(email, '..') = 0
  • The local part :
    • contains alphanumerics and - and _
    • could be separated on smaller part separated by dot
      • PurgeChar(Lower(Subfield(email, '@', 1)), 'abcdefghijklmnopqrstuvwxyz0123456789-_.') = ''
    • could not start or finish with a dot
      • Left(email, 1) <> '.'
      • SubStringCount(email, '.@') = 0
  • The domain part :
    • contains alphanumerics and - and _
    • could be separated on smaller part separated by dot
      • PurgeChar(Lower(Subfield(email, '@', 2)), 'abcdefghijklmnopqrstuvwxyz0123456789-_.') = ''
    • the las part have 2 or 3 alpha
      • PurgeChar(Lower(Subfield(Subfield(vEmail, '@', 2), '.', -1)), 'abcdefghijklmnopqrstuvwxyz') = ''
      • Len(Subfield(Subfield(vEmail, '@', 2), '.', -1)) >= 2
      • Len(Subfield(Subfield(vEmail, '@', 2), '.', -1)) <= 3
    • could not start or finish with a dot
      • SubStringCount(email, '@.') = 0
      • Right(email, 1) <> '.'

The best way is to use these small tests in the LOAD script to create a Flag :

if( test_1 and test_2 and test_3 and ... and test_n , 1, 0)  as _IsEmailValid

And use this expression in the front end : Sum(_IsEmailValid)

If you want to use it directly in set analysis without modify your load script, you need to write it like that :

Count({$<email={"= test_1 and test_2 and test_3 and ... and test_n "}>} email)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

That is a regular expression test. Regular expressions don't exist native in Qlik, you can't use Regular Expressions in set analysis.

As has been pointed out earlier, if using QlikVew, you can use regular expression tests in the load script by using module functions. For an example, see:

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

-Rob

http://masterssummit.com

http://qlikviewcookbook.com