February 12, 2010

How to remove a single quote from a string in QlikView?

Filed under: QlikView — J. Abram barneck @ 8:21 pm

Ok, so I had a problem today that I couldn’t find any documentation on. I needed to remove a single quote from a variable in a string during a load script but it took some time.

I tried this but it didn’t work:

purgechar(‘It’s got a quote’, ‘\”)

It turns out that QlikView doesn’t seem to have an escape character, so I had to figure out another method. Google searching for this string didn’t help: single quote Qlikview escape character

So I figured it out. You have to use the chr() function.

purgechar(‘It’s got a quote’, char(39))

You can get the correct ascii number to pass to the char() function from here:

So hopefully if you do the same google search you will find my post and not have to spend as much time as I did trying to figure this out.


1 Comment »

  1. It is chr() instead of char() in version 8.5:

    purgechar(‘It’s got a quote’, chr(39))

    Comment by Jeff — March 29, 2010 @ 11:35 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: