Like ifblank
, if not set
is a tag used to set a value to open-ended fields that are left unfilled. However, where ifblank
only acts on fields that are seen by the respondent, if not set
acts on all possible fields, regardless of whether or not they are seen. The input to if not set
can be any positive integer or '0', and is most commonly 0. The input value is set in the data once the parent question validates successfully.
This data cleaning tag is important for more advanced reporting functionality like averages, and situations where a blank is not the same as a 0 (zero). The if not set
tag is most useful for a table that sums up to 100%; any spaces that are not filled are implicitly considered to be '0' for the calculation.
Note: This tag currently works only with open-ended fields. Survey Programmers (SPs) should include required: n
with if not set
in r8.0+.
Syntax
if not set: value # value = any positive integer or 0
Example
In this example, Table 2 utilizes the showcolumntotal
(alias sct
) set of tags such that the respondent must enter values in the table which sum to 100 percent. Once the total is equal to 100, the question will validate successfully upon submission. Only options selected at T2 are shown as rows. Any rows hidden at T2 due to not being selected in Q1 are auto-populated with a '0' when the table is submitted.
Comments
0 comments
Please sign in to leave a comment.