Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Say for example that I have a field named Email_Address with many records and i wanted to identify incorrect email addresses.
For example I may want to count the number of @ characters in each records in order to flag any instances with more than one
Any thought appreciated
Thanks
Stuart
Can you check this site
Regular expressions in the load script - The Qlik Fix! The Qlik Fix!
you can count the number of @ with substringcount
substingcount(string,'@') gives you th enumber of occurances of the sign @
Hi Stuart,
you could use substringcount for this
If(substringcount([Email Field], '@')>1, 'Your Flag Here') As Flag
hope that helps
Joe
Hi,
That one seems to count the overall count of instances. What I was interested in was counting instances where we had an incorrect email like
test@@test.com
Any thoughts?
I donot think that there is a sinple solutio
you can test for any combinations which you know as you stated and using
substringcount(string,'@@') etc.
I know ist annoying. But maybe another Person has a better idea
Rudolf and Joe have got the solution.
Any email address with more than one @ in the string is invalid, so I can't see a down side to Joes IF statement...
Regards,
M.
Isn't that essentially gives a logic like - 'A mail address is incorrect if not it contains only one @ character' ? If agreed, you can easily put it like:
Load
If(SubstringCount( MailAddfield, '@') =1, 'Correct', 'Incorrect') as Flag
Isn't it?
What Martyn said really, that should work fine, regardless of being together or not, having two '@' is invalid.
If you want to start building multiple rules for what is considered valid, then that would probably need something a bit more complex
What if the count is zero?