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.

aaroncouran
Contributor III

Remove an unwanted special character

Does anybody have any ideas on how to get rid of this character from a text string?

 

I tried replace, but it doesn't seem to recognize it:

REPLACE(TextString,'  ','') AS TextClean,

Tags (2)
5 Replies
aaroncouran
Contributor III

Remove an unwanted special character

sQuare Character.png

Had to insert a picture since it wouldn't display in the forum.  This is fiendish little character!  Any ideas to dispose of it are welcome.

msheraton
Contributor III

Remove an unwanted special character

Do you know what the special character actually is?

ie if it was a tab you could do purgechar(TextString,char(9))

Replace 9 with the correct value.

 

Mark

aaroncouran
Contributor III

Remove an unwanted special character

OK, so I think the character is Unicode U+25A1.  I am not sure there is a conversion to ASCII.  If there was, I could use CHR().  Is there a way to add support for this unicode character in my script or another function that would handle this?

krishna_2644
Valued Contributor III

Re: Remove an unwanted special character

Hi Aaron,

You can use PurgeChar() function to remove unwanted characters from a string.

Eg: If one of the record in the field Full_Name: Jam3e#s Ca%mer~on

Then PurgeChar(Full_Name,'3,#,%,~'returns  Full_Name: James Cameron.

Hope that helps.

Thanks

krishna

Not applicable

Re: Remove an unwanted special character

Please use KeepChar

eg:  KeepChar(Field,'abcdefg......xyz1234567890') as Field