Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How Do I Strip out Special Chars from a Cross Table

Hi all,

I've created a cross table and I want to strip out the following special characters (paretheses and quotes) but keep all alpha-numeric characters in my data field:

" { } "


How do I do this in QV developer or is it even possible?

I tried using KeepChar and PurgeChar with no luck.


as follows:

CrossTable(Column1, Data)

LOAD * FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq)

where keepchar ( '{"abcdefghijklmnopqrstuvwxyz"}','abcdefghijklmnopqrstuvwxyz' );

Any Ideas would be greatly appreciated.

1 Solution

Accepted Solutions
Not applicable
Author

Thank you Shyam! Very much appreciate it!

Here is how it looks now with your help!

XXData:

CrossTable(Column1, Data)

LOAD * FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq);

XXData2:

Load * ,

KeepChar(Data,'abcdefghijklmnopqrstuvwxyz0123456789') as Desc

Resident XXData;

DROP Table XXData

View solution in original post

2 Replies
Not applicable
Author

Hi Frank,

PurgeChar should do it for you. Something like below --

Test:

load

    *,

    PurgeChar(Desc,'{}') as Desc2,

    KeepChar(Desc,'{}123') as Desc3;

LOAD * INLINE [

    Test, Desc

    1, 12321absajh

    2, ab{njskjdsij}

];

Hope this helps.

Cheers,

Shyam

Not applicable
Author

Thank you Shyam! Very much appreciate it!

Here is how it looks now with your help!

XXData:

CrossTable(Column1, Data)

LOAD * FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq);

XXData2:

Load * ,

KeepChar(Data,'abcdefghijklmnopqrstuvwxyz0123456789') as Desc

Resident XXData;

DROP Table XXData