I want to evaluate phone numbers. Unfortunately, there are many characters that do not belong in the phone number.
I would like to sort out or mark all unusable phone numbers in the loading script.
This includes all letters (A-Z) and special characters, etc.
Which function can I use to do this best?
if(WildMatch(CalledNumber, '*#*', '*ABCDEFGHIJKLMNOPQRSTUVWXYZ#abcdefghijklmnopqrstuvwxyz.:-ß@/%^\*')>0, 'NO', 'YES') as Flag_Useable
It doesn't work with "WildMatch"function.
Can you help me please? 😀
I think both @BrunPierre and @MarcoWedel have a good approach to the problem, checking that only valid chars are used instead of listning all non-acceptable characters.
However, if you do want to go for an illegal characters check in your string then you can use this:
If(FindOneOf([CalledNumber],'ABCDEFGHIJKLMNOPQRSTUVWXYZ#abcdefghijklmnopqrstuvwxyz.:-ß@/%^\')=0, 'YES,'NO') as Flag_Useable
This removes letters and special characters from a string field. The output is numerical.
KeepChar(KeepChar(CalledNumber,'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),'0123456789') as Number
If(Len(PurgeChar(CalledNumber,'0123456789')), 'NO', 'YES') as Flag_Useable
I think both @BrunPierre and @MarcoWedel have a good approach to the problem, checking that only valid chars are used instead of listning all non-acceptable characters.
However, if you do want to go for an illegal characters check in your string then you can use this:
If(FindOneOf([CalledNumber],'ABCDEFGHIJKLMNOPQRSTUVWXYZ#abcdefghijklmnopqrstuvwxyz.:-ß@/%^\')=0, 'YES,'NO') as Flag_Useable