Masking code boxes

Code boxes, along with code labels (i.e. response options) can be hidden for multiple and single response type questions. These response options can be hidden in a matter of two ways, statically and dynamically.

Static masking is used to hide a response option in all conditions of the survey. Meaning, once applied to a question the response option will always be hidden. This might be useful for grid questions where one option is not applicable for a specific row within the grid. When used, the response option that is desired to be hidden is referenced and prefaced with the word “not” (i.e. “not 5”).

Dynamic masking is used to conditionally show response options based on a response to a previous question. This type of masking can be used to customize a survey’s response options based on how a respondent is answering questions.

Below are two examples of dynamic masking. Static masking will not be covered directly in this work sheet.

Example One: Masking follow-up questions with the response options

  1. First, there will need to be two questions with identical response options. The best way to do this is by cloning the first question to make the second. To clone a question, select it in the Questionnaire Design window QuestionnaireIcon.png .
please-select-step-1a.jpg
  1. Click Clone CloneIcon.png to clone the selected question which will appear just below the selected question. The text of the cloned question should be edited appropriately and the response type can be changed to single:
which-of-the-following-step-1a-2.jpg
  1. The masking feature should be applied to the cloned question; in this example that’s Q2. To apply masking, right click the question and select Variable Properties. This opens the Variable Properties window where you can set the Mask property.
  2. To Mask the cloned question so that only the options selected in a previous question are shown, the following syntax should be applied: “Question Name” (i.e. Q1)
Eg1VarProps1.PNG
  1. If the opposite masking is desired (show response options that were not selected), the syntax should be as follows: “not Question Name” (i.e. not Q1)
  2. Once the masking is applied, click Save SaveIcon.png to save the questionnaire.
  3. To preview the masking feature, publish the survey in preview mode PublishIcon.png.

Example Two: Conditionally masking using derived variables.

In this example respondents will first pick the location where they work. Then, based on the location they picked, the response options of a latter question will only show the options available at that location. This would be useful in situations where response options for a question need to be grouped together and filtered out based on previous responses.

  1. Create a question that will represent each group of masked options. In this example there will be three office locations:
which-office-ex2-step1.jpg
  1. Now create the question that will contain masking. This question should contain all of the possible response options. For example:
which-of-the-following-step-1a-2.jpg
  1. Next, the derived variable that determines the logic of the applied masking should be created. Click Variables and select the question being masked from the variables list, Q2.
  2. Click Clone CloneIcon.png to create a new variable based on the selected question, Q2.
  3. Edit the new variable so that the Type is set to Derived and Response is set to Multiple.
  4. Set the code values for each response option in the derived variable. Each code value response references the masking question, for example Q1=(1,2,3)
  5. The following shows the values for the departments at each office location:
    • London has Customer Services and Training
    • New York has Accounting, Customer Services, Human Resources, IT Support, Research, Sales and Training
    • Paris has Accounting, Customer Services, Data Center, Development, Human Resources, IT Support, Research, Sales and Training.
  1. Click Save SaveIcon.png to save the derived variable.
  2. In the Questionnaire QuestionnaireIcon.pngwindow, select the masked question, right click and select Variable Properties VariablePropsIcon.png.
  3. In the Mask property enter the name of the derived variable, V1, as the masking value:
Eg2VarProps1.PNG
  1. Click OK to save the masking value.
  2. Once the masking is applied, click Save SaveIcon.png to save the survey.
  3. To preview the masking feature in action, publish the survey in preview mode PublishIcon.png.

Alternative masking derived variable definition

There is an alternative way to define the derived variable used for masking. When the Toggle Definition ToggleDefnIcon.PNG is selected the definition fields are shown, including the Initial Value field. The Initial Value field can be used to enter a calculation that provides the basis for the values in the code list. This simplifies the code values when using a long calculation. The diagram shows the equivalent derived variables; one with an initial value and one without. Both these derived variables will behave in the same way.

If there is a topic you would like a tutorial on, email to snapideas@snapsurveys.com

Contents