Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Are Keepchar & Purgechar case sensitive?

Are keepchar & purgechar case sensitive?  For example, if I want to purge all occurrences of the letter E (both upper and lower case), would I need to say  purgechar(FIELD1,'Ee') as NEW_FIELD

Labels (1)
8 Replies
MK_QSL
MVP
MVP

Yes PurgeChar and KeepChar are case sensitive.

You need to write...

PurgeChar(FIELD,'Ee') as NEW_FIELD

el_aprendiz111
Specialist
Specialist

Hi,

1 example:

PurgeChar(FIELD,'0123456789$*-@#&') AS FIELD_CLEAR,
KeepChar(FIELD_CODE,'0123456789') AS CODE_CLEAR;

LOAD * Inline
[
FIELD, FIELD_CODE
Jhons09&5, 0001DSFJHDS
Alf$*--15, 0002SDFSSDS
Don@#$,    DFDSFSDR0003DSFJHDS
Mich0123456789, DFGDFRG0004DSFJHDS

]
;

el_aprendiz111
Specialist
Specialist

escese me:

LOAD *,
PurgeChar(FIELD,'0123456789$*-@#&') AS FIELD_CLEAR,
KeepChar(FIELD_CODE,'0123456789') AS CODE_CLEAR;
LOAD * Inline
[
FIELD, FIELD_CODE
Jhons09&5, 0001DSFJHDS
Alf$*--15, 0002SDFSSDS
Don@#$,    DFDSFSDR0003DSFJHDS
Mich0123456789, DFGDFRG0004DSFJHDS

]
;

sunny_talwar

Or you can do this:

PurgeChar(Upper(FIELD1),'E')


or


PurgeChar(Lower(FIELD1),'e')

swuehl
Champion III
Champion III

Sunny, wouldn't this potentially change also the case of characters one may want to keep?

sunny_talwar

Yes it would ...

But at times that might be acceptable. In times it is not, I would use Manish's script

Clever_Anjos
Support
Support

afaik almost all qv functions are case sensitive

Not applicable
Author

Thanks much.