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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
adiarnon
Creator III
Creator III

replacf function

hi,

i have string and i need to delete the ' and the "

exemple:

'aklasdfj'dasdf ->aklasdfjdasdf

(without ')

"a"das"df ->adasdf

(without ")

how can i do it?

Labels (1)
6 Replies
its_anandrjs
Champion III
Champion III

Try This ways

LOAD *,KeepChar(StringChar,'abcdefghijklmnopqrstuvwxyz') as  NewChar;

LOAD * Inline

[

StringChar

'aklasdfj'dasdf

"a"das"df

];

Regards

Anand

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Purgechar(MyString, '''"')

That's an opening single quote, then two single quotes so the first escapes the second, then a double quote and finally a closing single quote.


talk is cheap, supply exceeds demand
sunny_talwar
MVP
MVP

Or this:

PurgeChar(Fieldname, Chr(39)) as NewFieldName


UPDATE:

for both single and double quotes, you can try this:

PurgeChar(Fieldname, Chr(34)&Chr(39)) as NewFieldName

maxgro
MVP
MVP

load

  field,

  PurgeChar(field, chr(39)&chr(34)) as newfield

inline [

field

'aklasdfj'dasdf

(without ')

"a"das"df

];

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

That's probably a better solution. Easier to read and understand than all those quotes.


talk is cheap, supply exceeds demand
Anonymous
Not applicable

Hi Adi,

I will use PurgeChar() function.

PurgeChar(YourString, YourCharToRemove)

Quote and Double Quote = chr(39) and chr(34)

See complete Ascii table: http://www.asciitable.com/

Best

Maurice