UCL WIKI

UCL Logo
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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):

Anchor
Example10
Example10

Example 10 Questionnaire: NCDS Parental Questionnaire 1974


Questionnaire layout:


Archivist view (ncds_74_pq):  

...

Archivist view (alspac_04_pal):


Anchor

...

Date

...

Date
Using Date in condition logic

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)


Questionnaire view:

Image Added



Archivist view (nshd_72_mq):

Image Added


Anchor
Grid Coordinates
Grid Coordinates

Tip
iconfalse
titleTable 1. Condition Notation

Comparisons

==

Is equal to

!=

Is NOT equal to

Less than

Greater than

Joining

&&

To join two comparisons using an AND

||

To join two comparisons using an OR

Qualifiers

‘ (single quote)

Meta value (numeric)

“ (double quote)

Literal string

...

(text, date)



Tip
borderWidth= 500.0px;
iconfalse
titleTable 2

Grid coordinates

$X$Col;YRow

Used to specify a cell or multiple cells of a grid


qc_example$3example$1;21


Example

Col 1Col

Row 1


Row 2


Col Row 3



qc_example$1;2

Example

Col 1

Row 1


Row 2


Row 3



qc_example$2;*


Example

Col 1

Col 2

Col 3

Row 1




Row 2




Row 3





qc_example$*;1


Example

Col 1

Col 2

Col 3

Row 1




Row 2




Row 3





qc_example


Example

Col 1

Col 2

Col 3

Row 1




Row 2




Row 3





qc_example$2:3;*

Example

Col 1

Col 2

Col 3

Row 1




Row 2




Row 3





qc_example$1,3;*

Example

Col 1

Col 2

Col 3

Row 1




Row 2




Row 3




...