Snap XMP Help

Filter expressions

You are here:
< All Topics
image_pdfimage_print

Filter expressions are logical Boolean expressions. The general format of filter expressions is:

operand operator operand

The operand may be:

  • one or more question variables
  • one or more numbers
  • one or more pieces of text enclosed in quotation marks (This is called a text string)
  • a complete expression enclosed in braces

You may also apply a pattern to the operand, for example, to search for dates within a specific range

The operator must be one of the following:

SymbolTextMeaningFilter_ExampleDescription
=MTmatchQ2=1To select respondents who have given answer 1 to question 2. (If question 2 is a Multiple Response question they may have given other answers as well).
==EQexact matchQ4==1To select respondents who have given only answer 1 to question 4. If question 1 is a Multiple Response question they must have given no other answer in addition to answer 1.
>GTgreater thanQ5 GT 50
Q5>50
To select only respondents who have given a value of greater than 50 at question 5.
>=GEgreater than or equal toQ5 GE 50
Q5>=50
To select only respondents who have given a value of greater than or equal to 50 at question 5.
<LTless thanQ5 LT 50
Q5<50
To select only respondents who have given a value of less than 50 at question 5.
<=LEless than or equal toQ5 LE 50
Q5<=50
To select only respondents who have given a value of less than or equal to 50 at question 5.

Items or expressions may be grouped together using the following operators

,ORor any of the items separated by , or ORQ2=1 OR Q2=2
Q2=1,Q2=2
Q2=(1 OR 2)
Q2=(1,2)
To select only respondents who have given answer 1 or answer 2 to question 2.
~TOor range: any item in the range between the two terms separated by ~ or TOQ2=(1 TO 3)
Q2=(1~3)
To select respondents who have given answers within the range 1 to 3 to question 2. (1 or 2 or 3).
&ANDand: both the terms separated by & or ANDQ2=1 AND Q4=1
Q2=1&Q4=1
To select respondents who have given answer 1 to question 2 and also given answer 1 to question 4.
!NOT or UNLESSnot: all cases not included in the following expressionNOT Q2=1
UNLESS Q2=1
!Q2=1
To select respondents who have not given answer 1 to question 2.

Items may be identified using the following operators

#NUMthe number of replies selected in a multi-response questionsnum Q5>3 To select only respondents who have given more than three answers to question Q5
 CASEthe specified case(s)case >100All cases after the first hundred
Contents