Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluding from selection without selecting excluded!

Is there a way to exclude a value from a selection without specifically selecting excluded? For example, if the values are A, B, C, D and E and I want to select all except E, I can select E and then choose Select Excluded. But this specifically selects A, B, C and D. If I make this a bookmark called "All but E" and if later on, a value of F shows up in my data - I want the bookmark to select A, B, C, D and F.

But that is not what happens. The selection remains A, B, C, and D. So now, E and F are not selected.

Does anyone know a way around this?

1 Solution

Accepted Solutions
biester
Specialist
Specialist

Hi,

try this one:
Type:

= NOT Fieldname LIKE 'E'

into the searchbox (remove the default '**' before of course) and save selection as a bookmark. In the current selection box you can see exactly THIS clause (and NOT 'A, B, C, D'). And if another records with e. g. 'F', 'G' are added, the selection is still valid: A,B,C,D,F,G will appear when recalling the bookmark (as it really is saved as typed in).

Rgds,
Joachim

View solution in original post

3 Replies
biester
Specialist
Specialist

Hi,

try this one:
Type:

= NOT Fieldname LIKE 'E'

into the searchbox (remove the default '**' before of course) and save selection as a bookmark. In the current selection box you can see exactly THIS clause (and NOT 'A, B, C, D'). And if another records with e. g. 'F', 'G' are added, the selection is still valid: A,B,C,D,F,G will appear when recalling the bookmark (as it really is saved as typed in).

Rgds,
Joachim

Not applicable
Author

This worked brilliantly. Thanks for your help. I also needed to do an AND with this and found some help you gave someone elsewhere in the forum.

But this does bring to mind another question. If I am doing Not 'A' and I also want to exclude 'B', would I say not (fieldname like 'a') and not (fieldname like 'b')? or would I need to use an OR here? Sorry, but they both seem to make sense to me. Is one used with NOT specifically?

Regards,

Patrice

biester
Specialist
Specialist

Hi,

if you want to exclude both A and B, you should use:

= NOT (Letter like 'A') and NOT (Letter like 'B')

As to the "OR" question, have a look at the truth table for the logical disjunction = OR (http://en.wikipedia.org/wiki/Truth_table#Logical_disjunction). If we make up the search pattern as:

= NOT (Letter like 'A') and NOT (Letter like 'B') and we say that

NOT (Letter like 'A') is proposition p and

NOT (Letter like 'B') is proposition q according to this table

and we assume we have four letters here (A,B,C,D), with which I will substitute 'Letter' in the following then the truth table would be as follows:

A: NOT (A like A): FALSE / NOT (A like B): TRUE : FALSE OR TRUE is TRUE
B: NOT (B like A): TRUE / NOT (B like B): FALSE : TRUE OR FALSE is TRUE
C: NOT (C like A): TRUE / NOT (C like B): TRUE : TRUE OR TRUE is TRUE
😧 NOT (D like A): TRUE / NOT (D like B): TRUE : TRUE OR TRUE is TRUE

ONLY FALSE OR FALSE would be TRUE, that means p and q would have to be false, so (x like A) would have to be true (then NOT (x like A) would be false) AND (x like B) would have to be true (then NOT (x like B) would be false). But that means that (x like A) AND (x like B) would have to be true, and that's not possible, so any of the letters will be selected using OR.

Sorry for my excursion to logics, but this was also for myself to assure that QlikView logic is working in conformity with general logic. So I'd say only AND produces the desired result.

Sorry again for my abundant explanation, but I hope it's clear - anyone correct me if I have a mistake in my flow of thoughts, it's already late ....

Rgds,
Joachim