Discussion Board for collaboration on QlikView Scripting.
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
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 @
you could use substringcount for this
If(substringcount([Email Field], '@')>1, 'Your Flag Here') As Flag
hope that helps
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
I donot think that there is a sinple solutio
you can test for any combinations which you know as you stated and using
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...
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:
If(SubstringCount( MailAddfield, '@') =1, 'Correct', 'Incorrect') as Flag
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?