Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

How to exclude '*' values in set analysis.

Hi there,

Just want to know if there is any way to exclude the field which contained character '*'.

I have tried the following but not luck.

count({<FieldA={"*"}-{"**"}>} id)

Anyone have any idea?

Best Regards,
Karl

1 Solution

Accepted Solutions

Re: How to exclude '*' values in set analysis.

To work around the problem of the * being misinterpreted as a wildcard, I would use the set search argument:

{"=index(FieldA,'*')>0"}

Then the exact syntax depends on whether you want to remove FieldA  * strings from the current set:

=Count({<FieldA-={"=index(FieldA,'*')>0"}>}FieldA)

or select the set where FieldA does not contain *

=Count({<FieldA=-{"=index(FieldA,'*')>0"}>}FieldA)


Note the only difference between the two is in the use  of -= or =-.


-Rob

http://masterssummit.com

http://robwunderlich.com

3 Replies
Not applicable

Re: How to exclude '*' values in set analysis.

Aha, I come up with a compromise solution, that is, use 'if' clause to rename the data '**' to '999999' in the load script, then in the set analysis

count({<FieldA={"*"}-{"999999"}>} id)


Not applicable

Re: How to exclude '*' values in set analysis.

To perform forced exclusion of a string you should use '~' before the specific field set analysis.


To include '*' char in string comparison set you should use escape solution (like char(42))


Something like this: Count( {$<~FieldA= {"*$(=chr(42))*"}>} id)


Try different ways to escape '*' char..


Hope that will help you..

Re: How to exclude '*' values in set analysis.

To work around the problem of the * being misinterpreted as a wildcard, I would use the set search argument:

{"=index(FieldA,'*')>0"}

Then the exact syntax depends on whether you want to remove FieldA  * strings from the current set:

=Count({<FieldA-={"=index(FieldA,'*')>0"}>}FieldA)

or select the set where FieldA does not contain *

=Count({<FieldA=-{"=index(FieldA,'*')>0"}>}FieldA)


Note the only difference between the two is in the use  of -= or =-.


-Rob

http://masterssummit.com

http://robwunderlich.com

Community Browser