| Compound Branching based on answers to multiple questions - How to? |
|
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 Restrictions
This feature/tool [Custom Scoring Logic and Dynamic Scripting] is not available as part of any of our standard self-service licenses. It is part of our Enterprise Service License. Please contact your Account Manager for pricing and options for purchasing the Enterprise Service License.
|
|
READY? TRY IT TODAY. IT'S FREE.
|
|