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: 
Neha121
Contributor III
Contributor III

Remove ' from text

Hi,

  My text is SOLICITOR'S OFFICE in one of the dimension. I want to remove ' before S. how do I do that in script. how do I use replace().

 

Thanks.

 

 

1 Solution

Accepted Solutions
Digvijay_Singh
MVP
MVP

Works for me, see if you did something different than I did as below - 
 
data:
 
Load *,
Replace(text,'''S','S') as text_modified
;
Load * inline [
text
SOLICITOR'S OFFICE
];

Digvijay_Singh_0-1742444468313.png

 

View solution in original post

8 Replies
Digvijay_Singh
MVP
MVP

Something like this or a little different based on what fits for you may be - 

Replace(text,'''S','S')

Neha121
Contributor III
Contributor III
Author

tried this but doesn't work

Digvijay_Singh
MVP
MVP

Works for me, see if you did something different than I did as below - 
 
data:
 
Load *,
Replace(text,'''S','S') as text_modified
;
Load * inline [
text
SOLICITOR'S OFFICE
];

Digvijay_Singh_0-1742444468313.png

 

Chanty4u
MVP
MVP

Try this 

LOAD  

    Replace([YourField], '''', '') AS CleanedField  

FROM [YourSource];

 

Or 

LOAD  

    PurgeChar([YourField], ' ' ' ') AS CleanedField  

FROM [Your source];

 

simsa
Contributor III
Contributor III

Any of the below method will do:

simsa_0-1742453467130.png

simsa_0-1742453809947.png

 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

Maybe you are having different character than ' ?

Answers above are correct so you may want to just make sure you are replacing correct character as it can be different than '. 

It may be ' or ` or something else

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Chanty4u
MVP
MVP

Or you can use  A to Z all upper case and a to z lower case in ' ' below expression 

LOAD  

    KeepChar(field, 'A-Z a-z ') AS CleaText  

FROM source 

 

So that you can remove any symbols ...it will keep only characters

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Neha121 

If the above solutions dont work using KeepChar() 

 

Example

KeepChar(Field, 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 0123456789') as TestFieldWithoutChar

 

Regards Jandre 

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn