Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
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.

RedSky001
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