List of Different Survent Types of Conditions

Below is a list of different types of Survent questions and different types of Survent conditions that can be used per question type.

IF Conditions for FIELD Type Questions

FIELD questions can reference either a question label or the data location of the question label or the actual data location.

FIELD questions are either equal to code(s) or not equal (<> or NOT) to code(s).

NOTE: X and Y below represent some number.


Single Code Examples

!IF QLABEL(response code X)
!IF QLABEL(<>response code X)
!IF NOT(QLABEL(response code X))

!IF [QLABEL#response code X]
!IF NOT([QLABEL#response code X])

!IF [10#response code X]
!IF NOT([10#response code X])

!IF Q1(01)
!IF Q10(2)
!IF Q50(<>99)
!IF [Q100#1]
!IF QLABEL(response code 1 – response code X)
!IF QLABEL(<>response code 1 – response code X)
!IF NOT(QLABEL(response code 1 – response code X))

!IF [QLABEL#response code 1 – response code X]
!IF NOT([QLABEL#response code 1 – response code X])

!IF [10#1-X]
!IF NOT([10#1-X])

!IF Q1(01-05)
!IF Q10(2-9)
!IF Q50(<>90-99)
!IF [Q100#1-6]
!IF QLABEL(response code 1, response code 2, response code X)
!IF QLABEL(<>response code 1, response code 2, response code X)
!IF NOT(QLABEL(response code 1, response code 2, response code X))

!IF [QLABEL#response code 1, response code 2, response code X]
!IF NOT([QLABEL#response code 1, response code 2, response code X])

!IF [10#1,2,X]
!IF NOT([10#1,2,X])

!IF Q1(01,20,99)
!IF Q10(2,4,6)
!IF Q50(<>98,99)
!IF [Q100#1,5,9]
!IF QLABEL(response code 1 – response code X, response code Y)
!IF QLABEL(<>response code 1 – response code X, response code Y)
!IF NOT(QLABEL(response code 1 – response code X, response code Y))

!IF [QLABEL#response code 1 – response code X, response code Y]
!IF NOT([QLABEL#response code 1 – response code X, response code Y])

!IF [10#1-X,Y]
!IF NOT([10#1-X,Y])

!IF Q1(01-10,50)
!IF Q10(2-4,9)
!IF Q50(<>20-30,99)
!IF [Q100#1-5,9]


IF Conditions for NUMERIC Type Questions

NUMERIC questions reference the data location of the question label or the actual data location.

NUMERIC questions use arithmetic operators in the conditions. You can also use literal strings in the conditions.

Arithmetic Operators Used:

= EQUAL TO
<> NOT EQUAL TO
> GREATER THAN
>= GREATER THAN OR EQUAL TO
< LESS THAN
<= LESS THAN OR EQUAL TO

NOTE: X and Y below represent some number.
!IF [QLABEL#numberX]

!IF [QLABEL<>numberX]
!IF NOT([QLABEL#numberX])

!IF [10#1]
!IF [10<>1]
!IF NOT([10#1])

!IF [Q1#01]
!IF [Q10#99]
!IF NOT([Q50#99])
!IF [QLABEL#number1,number2,numberX]

!IF [QLABEL<>number1, number2, numberX]
!IF NOT([QLABEL#number1, number2, numberX])

!IF [10#1,2,X]
!IF [10<>1,2,X]
!IF NOT([10#1,2,X])

!IF [Q1#01]
!IF [Q10#99]
!IF NOT([Q50#99])
!IF [QLABEL#number1-numberX]

!IF [QLABEL<>number1-numberX]
!IF NOT([QLABEL#number1-numberX])

!IF [10#1-X]
!IF [10<>1-X]
!IF NOT([10#1-X])

!IF [Q1#18-65]
!IF [Q10#1-100]
!IF NOT([Q50#95-99])
!IF [QLABEL#number1-numberX,numberY]

!IF [QLABEL<>number1-numberX,numberY]
!IF NOT([QLABEL#number1-numberX,numberY])

!IF [10#1-X,Y]
!IF [10<>1-X,Y]
!IF NOT([10#1-X,Y])

!IF [Q1#18-65,90]
!IF [Q10#1-100,999]
!IF [Q50<>95-99,998]
!IF [QLABEL] = numberX
!IF [QLABEL]<>number

!IF [Q1]=99
!IF [Q1]<>99

!IF [QLABEL]>numberX
!IF [QLABEL]>=number

!IF [Q1]>18
!IF [Q5]>=25

!IF [QLABEL]<numberX
!IF [QLABEL]<=numberX

!IF [Q10]<99
!IF [Q50]<=65
!IF [QLABEL$]=”literal”
!IF [10$]=”DK”

!IF [Q20$]=”DK”

!IF [QLABEL$]<>”literal”
!IF [10$]<>”DK”
!IF NOT([10$]=”DK”)

!IF NOT([Q20$]=”RF”)

!IF [QLABEL$”literal1″,”literal2″]
!IF [10$”DK”,”RF”]
!IF NOT([10$”DK”,”RF”])

!IF [Q20$”DK”,”RF”]


IF Conditions for VARIABLE Type Questions

VARIABLE questions reference the data location of the question label or the actual data location.

VARIABLE questions either equal the literal string of data or not equal(<> or NOT) the literal string of data.

NOTE: X and N below represent some number.


!IF [QLABEL$]=”TEXT”
!IF [10$]=”TEXT”

!IF [Q1$]=”New Orleans”
!IF [Q1.3$]=”New”

!IF [QLABEL$]<>”TEXT”
!IF NOT([QLABEL$]=”TEXT”)

!IF [10$]<>”TEXT”
!IF NOT([10$]=”TEXT”)

!IF [Q1.3$]<>”New”
!IF NOT([Q1.3$]=”New”)

!IF [QLABEL$”TEXT”]
!IF NOT([QLABEL$”TEXT”])

!IF [10$”TEXT”]
!IF NOT([10$”TEXT”])

!IF [20.5$”Santa”]
!IF NOT([Q10$”Philadelphia”]

!IF [QLABEL$”TEXT1″,”TEXT2″,”TEXTX”]
!IF NOT([QLABEL$”TEXT1”,”TEXT2”,”TEXTX”])

!IF [10$”TEXT1”,”TEXT2”,”TEXTX”]
!IF NOT([10$”TEXT1”,”TEXT2”,”TEXTX”])

!IF [Q1$”Philadelphia”,”New York”,”Boston”]
!IF NOT([Q1$”Philadelphia”,”Boston”])
!IF [QLABEL#NNNNN]
!IF [QLABEL<>NNNNN]
!IF NOT([LABEL#NNNNN]

!IF [ZIPCODE#19030]
!IF [PHONE<>8880010001]


IF Conditions for TEXT Questions

TEXT questions reference the data location of the question label or the actual data location while using the CHECKTEXT function. !IF CHECKTEXT(LABEL) >1 – Data IS in the question referenced

!IF CHECKTEXT[10]>1

!IF CHECKTEXT(LABEL)<1 – Data is NOT in the question referenced or is BLANK
!IF CHECKTEXT[10]<1

!IF CHECKTEXT(Q1)>1
!IF CHECKTEXT(Q10)<1


The XF(MATCH_TEXT()) function can be used to look for a string of characters in VARIABE or TEXT questions. The functions will return a 0 if no specified strings are found.

The syntax for MATCH_TEXT allows you to use quotes around the string you are looking for. This is to properly look for commas and other special characters as part of the string.

The syntax is:

XF(MATCH_TEXT(QLABEL,”string 1”,”string 2″,”string n”))

XF(MATCH_TEXT(Q23,”Philadelphia,”Boston”))

NOTE: You can look for spaces and many special characters without quotes.
The XF(STRING_LENGTH()) function counts characters in strings in VARIABLE or TEXT questions.

The syntax is:

XF(STRING_LENGTH(<STRING VARIABLE OR “STRING”>))

!IF XF(STRING_LENGTH(Q23))

!IF XF(STRINGLEN(“THIS IS A STRING”))

!IF XF(STRINGLEN([1.5$]))

This requires a question label, a quoted string, or a string variable reference, and the question label used must be a VARIABLE or TEXT question.

NOTE: You can use a question data location or an actual data location for any question type to reference blank or not blank.
!IF [QLABEL^^B]

!IF [10^^B]

!IF [Q5^^B]
!IF [QLABEL^^NB]

!IF [10^^NB]

!IF [Q5^^NB]

COMPLEX IF CONDITIONS

More complex IF statements are built by joining two or more simple conditions or arithmetic statements with logical operators, and separating the logical operations with levels of parentheses.

The logical operators and their meanings are:

AND – The conditions on both sides of the operator are true
OR – At least one of the two conditions are true

You can combine the logical operators in any way, provided you use parentheses around the references that belong to each operator.

You can combine any type of question using any combination of the logical operators, provided you use parentheses around the references that belong to each operator.

You can use the question label, the question label data location, the actual data location itself, or any combination of these. !IF Q1(1) AND Q2(1)

!IF Q1(1) AND Q2(1) AND Q3(2)

!IF Q1(1) AND Q2<10

!IF Q1(1) AND [BRAND$]=”APPLE”

!IF Q1(1) AND Q2<10 AND [BRAND$]=”APPLE”

!IF [Q1#1] AND [Q2#1]

!IF [10#1] AND [11#1]

!IF Q1(1) AND [11#1] !IF Q1(1) OR Q2(1)
!IF Q1(1) OR Q2(1) OR Q3(2)

!IF Q1(1) OR Q2<10

!IF Q1(1) OR [BRAND$]=”APPLE”

!IF Q1(1) OR Q2<10 OR [BRAND$]=”APPLE”

!IF [Q1#1] OR [Q2#1]

!IF Q1(1) OR [11#1] !IF Q1(1) AND (Q2(1) OR Q3(2))

!IF (Q1(1) AND Q2(1)) OR Q3(2)

!IF [Q1#1] AND ([Q2#1] OR [Q3#2])

!IF ([Q1#1] AND [Q2#1]) OR [Q3#2]

!IF ([10#1] AND [11#1]) OR [12#2]

!IF Q1(1) AND ([11#1] OR [Q3#2])

NOTE: You can also use numeric or arithmetic operators or joiners in a condition statement.

EXAMPLE:

!IF (5 + [10.2]) / AGE > 23

This says that IF 5 plus the number in columns 10 and 11 divided by AGE is greater than 23, execute the statement.