The set of condition logic is based on Boolean operators (OR, AND, NOT) used in programming or database searching. These operators, particularly OR and AND, are used to combine pieces of condition logic code. The symbols || and && are used to denote OR and AND, respectively. See Example 5 above. Condition logic is placed within square brackets adjacent to the condition text. In Example 3 above, [qc_A3_a == 1] describes that the respondent should advance to the true branch if they responded with code list value 1 to question qc_A3_a.
The answer giving rise to a condition can be a code list value, numeric answer or a text answer. Most condition logic refers to a code list value from a previous question. The corresponding code value is used without any quotations as seen in Example 3. For numeric answers single quotations are used (see Example 9 below) and for text or date answers double quotation marks are used (see example 10 and example 17). Table 1. Condition Notation provides a summary.
Archivist view (ncds_69_eq):
Example 10 Questionnaire: NCDS Parental Questionnaire 1974
Archivist view (ncds_74_pq):
It is possible to have a condition which does not relate to a question. This is common in the introduction to a questionnaire. In Example 13 below, there is no previous question that the condition can be based on such as: 'Are you in full-time work?'. In this case, Therefore there is no condition logic to be entered and the square brackets will appear empty in the Archivist doc view.
As there is no question to reference for the condition, the condition label numbering uses the question number for is labelled after the first question that is dependent on the condition.that condition in this case qc_51e. See Construct a Label for more on how to name conditions.
Example 13 Questionnaire: NSHD Main Questionnaire 1989
Archivist view (alspac_04_pal):
When dates are indicated with numbers they can be represented in different ways. This could make a number of issues when interpreting the data in a later stage. Therefore we adopt ISO 8601 standard to tackle the uncertainty by setting out an internationally agreed way to represent the dates: YYYY-MM-DD
Example 17 Questionnaire: National Survey of Health and Development (nshd_72_mq)
Archivist view (nshd_72_mq):