Help/Support   
Online Surveys Made Easy
UNLIMITED Surveys, UNLIMITED Responses, Easy to Use
Email Address:
or Take a Tour

How to set up Compound Branching based on answers to multiple questions?

Example 1:

Q1 Gender?

Male
Female

Q2 Age?

Below 10
10 - 15
16 - 20
21 - 25
26 - 30
Above 30

Scenario: You want to branch respondents based on their Gender as well as Age to different sections of the Survey. Also you do not want respondents older than 30 years of age. You can do so using Custom Scripting.

The script for the above requirement is as follows:


#if(${Q2} == 6)
    $survey.branchTo("NotReqrd")
#end

#if(${Q1} == 1 && ${Q2} < 3)
    $survey.branchTo("MaleKid")
#end

#if(${Q1} == 2 && ${Q2} < 3)
    $survey.branchTo("FemaleKid")
#end

#if(${Q1} == 1 && (${Q2} > 3 && ${Q2} <= 5))
    $survey.branchTo("MaleAdlt")
#end

#if(${Q1} == 2 && (${Q2} > 3 && ${Q2} <= 5))
    $survey.branchTo("FemaleAdlt")
#end

  • The first if statement checks if the Respondent is Above 30 years of age. If this is true then the Survey has to end and the respondent is branched to Question with Question Code: NotReqrd
  • The second if Statement checks if the Respondent is Male and less than 20 Years of age and branches to the section beginning with Question Code: MaleKid
  • The third if Statement checks if the Respondent is Female and less than 20 Years of age and branches to the section beginning with Question Code: FemaleKid
  • The fourth if Statement checks if the Respondent is Male and greater than 20 Years of age but less than or equal to 30 and branches to the section beginning with Question Code: MaleAdlt
  • The fifth if Statement checks if the Respondent is Female and greater than 20 Years of age but less than or equal to 30 and branches to the section beginning with Question Code: FemaleAdlt

Following are the steps for setting this up:

  • Setup the basic survey with all the questions/sections.
  • Add the Custom Scripting/Scoring logic question after Q2 in the Survey
  • Setup the above Script in the Logic Question
  • Setup any other basic branching required for the individual blocks/sections of questions.
  • Make sure there is a page break on Q2

License & Access Options
This feature/tools described here are available with the following license(s) :
  • Team Edition
    • Unlimited Surveys, Questions, Responses
    • Advanced Toolset and Features
    • No Long Term Commitment

Join Now!
It's completely Free!
Survey Setup
Survey Distribution
Survey Analysis / Reporting
Accounts/Billing/Licensing
Site Policies and Procedures
New User Registration / Account Management
Multi-User Accounts : Corporate Accounts
Survey Creation - Details
Survey Building/Authoring - Details
Sending Survey - Details
Survey Administration - Details
Survey Tracking - Details
Analysis and Reporting - Details
Complex Logic Surveys
Conjoint Analysis
TURF Analysis
Trend Analysis
Pricing and Billing
Upgrading Access Restrictions
Advanced Survey Options
Enterprise Toolsets
Salesforce.com Integration
Tutorials
Student Research Sponsorship
Other (Sales/Billing/Partnerships)
© Copyright 2010 QuestionPro Survey Software a Division of Survey Analytics Enterprise Survey Software