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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
martynlloyd
Partner - Creator III
Partner - Creator III

Purgechar syntax problem

Hi, I'm trying to remove spaces and special characters from a string

I use  PurgeChar([Customer TOPS],' ,./-_+()£$!&*'), which is great.

But now I need to include the single quote as one of the chars to remove. I've tried square braces, using SET to create a variable, etc., but I just can't get the syntax right.

regards,

Marty.

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Hi Martyn,

Try this

PurgeChar(PurgeChar([Customer TOPS],chr(39)),'./-_+()£$!&*')

View solution in original post

5 Replies
qlikviewwizard
Master II
Master II

Hi MartynLloyd

Could you attach the sample application for better understanding and provide quick solution.

Thank you.

Kushal_Chawda
MVP
MVP

Instead of purge can you use keepchar()

for eg. if you want only numbers from string then use,

keepchar([Customer TOPS],'0123456789')


or


keepchar([Customer TOPS],'abcdefghijklmnopqrstuvwxyz')

sunny_talwar
MVP
MVP

For keeping letters, I would suggest a small edit:

KeepChar(Lower([Customer TOPS]), 'abcdefghijklmnopqrstuvwxyz')

Not applicable

Hi Martyn,

Try this

PurgeChar(PurgeChar([Customer TOPS],chr(39)),'./-_+()£$!&*')

Not applicable

Hi Martyn,

Try removing the ASCII value of apostrophe

PurgeChar(Lower(PurgeChar([Contractholder],' ,./-_+()£$!&*')),chr(39))