Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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.

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

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

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))