Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How to Remove a Single quote in a String

Hi All,

I have a requirement to do a Wildmatch on the string 'Reg'is' ,but as the string has a single quote after the letter g,its not taking the field value,have used Purgechar() function but unable to remove the single quote.

Please help me out on the function to be used.

Thanks,

Neha

1 Solution

Accepted Solutions
Not applicable

Re: How to Remove a Single quote in a String

In that case you can do something like if(Name='Reg'&Chr(39)&'is','Regis',Name)

You can do this in a list box expression or in the backend. This will replace

Reg'is with Regis

11 Replies
MVP
MVP

Re: How to Remove a Single quote in a String

this seems to work

load replace(col1, chr(39), '');

LOAD * INLINE [

col1Reg'is

aa''aa''aa

];

Clipboard01.jpg

rustyfishbones
Honored Contributor II

Re: How to Remove a Single quote in a String

Try REPLACE

REPLACE(YourField,CHR(39),'') as NewField

See the attached file

Not applicable

Re: How to Remove a Single quote in a String

While loading the data from source, remove the single quote with Replace function.

LOAD Replace(FieldName , chr(39) ,'') AS FieldName

.

.

.

;

SELECT * FROM TABLENAME ;

Not applicable

Re: How to Remove a Single quote in a String

Hey Neha,

Use

PurgeChar(Name,Chr(39)) as NewVAlue.

Here Chr(39) will give you '

Attached is a sample

Thanks

AJ

Not applicable

Re: How to Remove a Single quote in a String

Instead of Pulling it as a new value,can't we do it on the front end,cause I need to remove the single quote only from this single String value 'Reg'is'

Thanks,

Neha

santharubban
Contributor II

Re: How to Remove a Single quote in a String

YOU CAN TRY THIS

load PurgeChar(col1, '');

LOAD * INLINE [

col1Reg'is

aa'aa'aa

];

MVP
MVP

Re: How to Remove a Single quote in a String

in listbox use an expression

=replace(col1, chr(39), '')

in chart a calculated dimension (=replace(col1, chr(39), ''))

Not applicable

Re: How to Remove a Single quote in a String

In that case you can do something like if(Name='Reg'&Chr(39)&'is','Regis',Name)

You can do this in a list box expression or in the backend. This will replace

Reg'is with Regis

rustyfishbones
Honored Contributor II

Re: How to Remove a Single quote in a String

Yes you can use the same as a List Box Expression

REPLACE(YourField,CHR(39),'')