Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adnan_rafiq
Contributor II

Special Characters Restriction

Hi Experts,

I have a situation in which I have a column with descriptions, the problem is that if any of the special characters (that is any character other than 0 to 9, a to z , A to Z) are contained in it. I want to mark it.

The problem is tried looping through each value character by character , it becomes too much time taking.  I have about 20K values.


DescriptionI want mark
HelloOK
Hello)hiBad
ByeOK
Bye'sBad



All suggestion and help much appreciated , Especially from

stalwar1

Tags (1)
1 Solution

Accepted Solutions

Re: Special Characters Restriction

Haha, There is no such escape sequence in qlikview. But, Work around this?

LOAD  Replace(Description, '%', Chr(39)) as Desciption,

If(SubStringCount(KeepChar(Description,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%'),Description), 'OK', 'Bad') as [I want Mark];

LOAD Replace(Description, Chr(39), '%') as Description Inline [

Description

Hello

Hello)hi

Bye

Bye's

];

Note - If you ask in your data has  % as well. Then i suggest you to done where different character like Circle or Square ....

Capture.PNG

4 Replies

Re: Special Characters Restriction

May be this? If you have counted the different strings that may useful to use with PurgeChar()

LOAD Description, If(SubStringCount(KeepChar(Description,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),Description), 'OK', 'Bad') as [I want Mark] Inline [

Description

Hello

Hello)hi

Bye

Bye's

];

Capture.PNG

adnan_rafiq
Contributor II

Re: Special Characters Restriction

This seem fine, now a small complication what if I want to OK to some description that has single quote (')?

administarator
Contributor II

Re: Special Characters Restriction

Hi,

Please find the attached qvw. Hope this helps

Re: Special Characters Restriction

Haha, There is no such escape sequence in qlikview. But, Work around this?

LOAD  Replace(Description, '%', Chr(39)) as Desciption,

If(SubStringCount(KeepChar(Description,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%'),Description), 'OK', 'Bad') as [I want Mark];

LOAD Replace(Description, Chr(39), '%') as Description Inline [

Description

Hello

Hello)hi

Bye

Bye's

];

Note - If you ask in your data has  % as well. Then i suggest you to done where different character like Circle or Square ....

Capture.PNG