Skip Logic

Top  Previous  Next

Skip patterns (also known as branching) let respondents skip over sections of the questionnaire that don't apply, typically based on previous answers.  Lighthouse Studio provides flexible and powerful skip logic.  Skip instructions can either be executed before showing a question, or after the question is answered.  We refer to these classifications as pre-skips and post-skips:  


Pre-Skips - The skip instruction is evaluated and, if true, executed just prior to loading a question.  The typical use is to conditionally skip a question if a condition is true.  Otherwise, the question is displayed.



Post-Skips - The skip instruction is evaluated and, if true, executed after a respondent has answered the question and submitted the data on the page containing this question.


You have the option of providing a target question to skip to, or to skip to the "next question" (in the case of pre-skips).  A comment field is associated with each skip logic entry you provide, so you can make any notations to help you as you construct and test the questionnaire.


Skip patterns only operate when the survey runs on a web server (not during preview mode).  


Skip Settings


Skip from

Specify the question to skip from using this drop-down box.


Skip Type

This control is for specifying whether this is a Pre-Skip (skip is executed Before the question is shown) or Post-Skip (skip is executed After the question is answered).


Always skip

Indicates an unconditional skip.  The skip is always executed and no skip logic is necessary.


Skip if the following logic evaluates to true

Check this button if the skip is only to be executed if certain skip logic is true (provided in the text field directly below).


Skip to

Specify the question to skip to using this drop-down box.



You can optionally provide notes within this field to assist you in composing and testing your survey.


Skip Logic Syntax


Lighthouse Studio provides powerful skip logic syntax for executing skip patterns.  You type this logic into the text field directly below the Skip if the following logic evaluates to true radio button.


Supported Logical Operators:






Supported Mathematical Operators:


=, <, >, <=, >=, <> "not equal to"

+, -

/  "division"

*  "multiplication"

^  "raise to the power of"

mod  "modulo"


and all other Lighthouse Functions.

You can check whether the instructions (syntax) you provide are valid by clicking checklogic .  Syntax is also checked when you prepare your survey for local or remote web server.


(Note: skip logic has been implemented using Sawtooth Script.)


Example Syntax


Below are some examples of valid skip syntax.  If these statements evaluate to true, then the skip is executed.


Q1 = 23   "Skip if Q1 is equal to 23"

Q1_3 = 1   "Skip if the third response option is checked in multi-response question Q1"

Q1 <= 10   "Skip if Q1 is less than or equal to 10"

Q1 <> 99   "Skip if Q1 is not equal to 99"

Age > 17

(Age >= 18) and (Gender = 1)

(Age >= 18) or (Q1 = 23) or (Q2 > 3.534)

((ageQuestion > 17) Or (Not Shown(ageQuestion))) "Shown" is a function that returns true if the question specified in the parenthesis has been seen

Q23/(Q24+Q25) >= 23.5

(Q23*Q1)^0.5 < 10   "^" means "raised to the power of"

Q1OpenEnd="hello world"

Shown(Q1) "Skip if the respondent saw Q1, even if the respondent left Q1 blank"

ListHasParentMember(Q1List, 4) "Skip if Q1List contains list member #4 from its parent list"


If you change the name of a question or list in your questionnaire, the question or list name is NOT automatically updated in your skip logic.  You must do this manually.


Skip Logic Flow of Execution


Pre-skips are evaluated before a page loads.  If the questions on the page are randomized, any skip patterns associated with these questions are evaluated in their unrandomized order.



If a question is skipped, any post skip logic associated with the skipped question is ignored.  (Note that questions can be skipped due to skip logic, or also due to containing an empty constructed list.)



Post-skips are evaluated after the page is submitted, according to the unrandomized order of questions on the page.  The first post-skip logic that evaluates to true is executed and the rest are ignored.


Warning: a pre-skip that has a destination to a different page may cause other questions on the same page not to be displayed.  For example, consider a page containing questions Q10, Q11 and Q12.  If a pre-skip on Q12 skips to a later page, if the pre-skip logic associated with Q12 is true, it causes the entire page to be skipped.  In this case, one would want to place Q12 on its own page to ensure that Q10 and Q11 are displayed.


Hint:  You can create HTML/Filler questions that contain skip instructions (and perhaps no actual text to be shown on the screen).  This can help in some instances when you want to place skip instructions on a page, but do not want the skip instructions to be directly associated with a specific question (in case that question was conditionally skipped).


Performing Skips Based on "Select All That Apply" (Multi-Select) Questions


You can perform skip patterns based on "select all that apply" questions.  Assume a multiple-response question named Q1 that has 5 options.  Respondents can register up to 5 answers.  If item number three on the list was selected, then that item is referenced using "underscore notation": Q1_3 = 1.  If item three was not selected, then Q1_3 = 0.  If item number 1 was selected, then Q1_1 = 1, etc.


Constant Sum and Ranking questions also employ underscore notation.  For example, in a ranking question named Q10, if the third item is ranked 2nd, then Q10_3 = 2.  Grid-based questions can involve "double-underscore" notation, to indicate both row and column (for example Q10_r1_c2).  (Hint: if you are uncertain regarding how a variable involving underscore notation is named, you can preview the associated question and view its source HTML to confirm the variable's name.)


Randomizing items within a multiple-response list does not affect the operation of the system variable Question_#.  The item number after the underscore always refers to that item's position within the original, unrandomized list.


Unconditional Skips


Sometimes you want to perform a skip that has no conditions (it is always executed).  The section below "Randomly Displaying a Subset of a Block of Questions"  is an example that uses an unconditional skip.


Unconditional skips can also be useful, for example, if displaying a follow-up message when the response is somehow unacceptable.  Consider a numeric question (Age) that is used to indicate the respondent's age.  You can create an Explanatory Text question (no response required) on the next page directly following that numeric question.  That question might be named LessThan18 and the text might state:


"You must be 18 to qualify for this survey, please have the individual in your household who is 18 or older and whose birthday is closest to today continue this survey."


If the numeric value for Age is greater than 17, we want to skip to the next question in the survey (Q1).  But, if the value is 17 or less, LessThan18 is displayed with the text asking for an individual 18 or older.  An unconditional skip is created from LessThan18 back to Age, as follows:


 Skip from:                LessThan18        

 Skip Type:                Post-Skip (After the question is answered)

 Always skip                (checked)

 Skip to:                Age

 Comment:                Always skip back to Age from this question.


The survey cannot continue until a valid age is entered.  (We aren't advocating this approach from a survey research methodology standpoint, but have used this example as an illustration of unconditional skips.)



Skip Example:

Randomly Displaying One out of n Pages


Let's assume you have ten pages of questions, but you want respondents to randomly see just one page.  You could place an unconditional skip after the last question on each page, that skips to the question directly following the ten pages of questions.  Then, simply randomize the pages.  When the questionnaire runs, a random page appears and the skip is executed (skipping out of the series of 10 questions) when the page is submitted.


Skip Example:

Displaying a Random Subset of Questions on the Same Page


This is a somewhat advanced example that illustrates additional capabilities of Lighthouse Studio.  This example assumes you have a working knowledge of constructed lists.


Consider a situation in which there were 20 questions, but you wanted respondents to see just five of these questions, selected randomly.  This could be done as follows:


1.Create a predefined list called (for illustration) Integers using Compose | Lists... (the list has 20 items, integers 1 through 20, or letters a through t, etc.).


2.Under Compose | Lists, create a constructed list called NewIntegers with parent list Integers.  Add the Integers list to NewIntegers and then randomize the elements using the Randomize instruction. Drop all but the first five list elements using the ListMax instruction.


3.Place a pre-skip on each of the 20 questions, which skips the question if:


ListValue(NewIntegers,1)<>X And ListValue(NewIntegers,2)<>X And ListValue(NewIntegers,3)<>X And ListValue(NewIntegers,4)<>X And ListValue(NewIntegers,5)<>X


Where "X" is 1 for the first question, 2 for the second question, etc.


Additionally, if you place all 20 questions on separate pages, you can randomize the order of the pages by clicking Randomize... from the Write Questionnaire dialog.


Prohibited "Skip Backs"


You cannot skip to any question on the first page.




Questions not answered by a respondent evaluate to zero or "" (empty string).  Therefore, a skip based on Q5A < 5 will be true if Q5A was not seen by this respondent (Not Shown( )) or was seen but not answered (Not Answered( )).


If no questions are shown on a page due to pre-skips, the entire page is skipped as well.


You can conduct skip patterns based on JavaScript status.  If JavaScript( ) evaluates to true, then the respondent has JavaScript enabled.  If JavaScript( ) evaluates to false, then JavaScript is disabled. Note: Lighthouse Studio by default requires JavaScript and has an automatic error message (within the Error Messages tab) that asks respondents who have JavaScript disabled to enable JavaScript before proceeding.



Page link: