Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gulshanrohilla
Contributor

Doubt in email Validation....

Can anyone help me in how to validate a email address....?. below is the screenshot of the question

2nd question.PNG

Tags (1)
1 Solution

Accepted Solutions
rsvebeck
Valued Contributor

Re: Doubt in email Validation....

Great. If you agree on the answers, please close the question as "answered", so the community can focus on unanswered questions.


Thanks,


Robert

9 Replies
rsvebeck
Valued Contributor

Re: Doubt in email Validation....

if (purgechar(purgechar(Upper(Email),'ABCDEFGHIJKLMNOPQRSTUVXY.-_@')=Upper(Email),'Valid','Not valid') as Email.status



rsvebeck
Valued Contributor

Re: Doubt in email Validation....

Ooops


Not Purgechar. I meant keepchar...




rsvebeck
Valued Contributor

Re: Doubt in email Validation....

Here is it... finally



if (keepchar(Upper(Email),'ABCDEFGHIJKLMNOPQRSTUVWXYZ.-_@')=Upper(Email),'Valid','Not valid') as Email.status


gulshanrohilla
Contributor

Re: Doubt in email Validation....

thanks Robert

Now its working fine... Can you explain me this ('ABCDEFGHIJKLMNOPQRSTUVWXYZ.-_@') section...

rsvebeck
Valued Contributor

Re: Doubt in email Validation....



That is a list of the characters you want to keep from the email adress when comparing to the original content.


Keepchar examples:


keepchar('bonjour','jour') = 'bon'


keepchar('Abcd123','123') = '123'


purgechar is the opposite, it define which characters should be removed :


purgechar('bonjour','jour') = 'jour'


purgechar('Abcd123','123') = 'Abcd'


Have a look in the help files. They have often good examples. As a  beginner though it is dificult to know "what" to search for. But if you search for "string functions" in the help, you will find a lot of useful functions.


Robert














gulshanrohilla
Contributor

Re: Doubt in email Validation....

Thank You Robert again, but i just want to know why you are using hyphen and underscore(-_) in the substring..

rsvebeck
Valued Contributor

Re: Doubt in email Validation....

Oh, ok. Yes I added those because they are valid email characters and might exist, so they are needed for the comparison, in a general pupose. Perhaps they are not valid in your organization, if this is the case, just remove them.



gulshanrohilla
Contributor

Re: Doubt in email Validation....

ok, Got it

Thanks Robert

rsvebeck
Valued Contributor

Re: Doubt in email Validation....

Great. If you agree on the answers, please close the question as "answered", so the community can focus on unanswered questions.


Thanks,


Robert

Community Browser