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

How to flag false characters

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? 😀

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

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

View solution in original post

3 Replies
BrunPierre
Partner - Master
Partner - Master

This removes letters and special characters from a string field. The output is numerical.

KeepChar(KeepChar(CalledNumber,'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),'0123456789') as Number
MarcoWedel

If(Len(PurgeChar(CalledNumber,'0123456789')), 'NO', 'YES') as Flag_Useable

Vegar
MVP
MVP

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