Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhng34
Partner - Contributor III
Partner - Contributor III

Using PurgeChar function to detect specific characters

I would like to create a flag to detect if the "Firstname" field ("Prénom" in french) contains specific elements, apart from alphabetic characters, '-' and spaces.
So I wrote the following expression:
 
If(len(PurgeChar([Prénom],'ABCDEFGHIJKLMNOPQRSTUVWXYZ- '))>0,1,0) as FlagErrorFN
 
Result : Some first names were identified errors (1) even though they does not contain any specific character (ANAS, MAVA, RAPHALLE, NAMA).
 
Capture1.PNG

 

It seems like Qlik does not understand that I wanted to remove spaces with PurgeChar, and those names were identified errors because they contain some spaces before or after the name. For example, when I created a flag with Len(Prénom), it gave 5 for "ANAS", "MAVA", "NAVA" in stead of 4 so I think that these names contain spaces.
 

Could someone tell me what I have to write correctly to detect if the field "Prénom" does contain a specific character different of alphabetic charac, '-' and spaces ?

 

Thanks so much for your help,

Thanhng34

 
Labels (1)
1 Reply
Brett_Bleess
Former Employee
Former Employee

The only thing of which I can think is there is a space on those names in question, most likely at the end of the name would be my hunch, should be pretty easy to test by excluding that character to see what impact that has on things...  Best I have with what you have left here.  It would be more helpful if you could attach an app folks could dig into things further.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.