Cardinality
In addition to code list categories and their code values, cardinality must be added when creating a code list. Cardinality refers to the minimum and maximum numbers of selections a respondent can choose from a code list (i.e. whether a respondent can choose only one answer from a code list (1:1 relationship) or all that apply (1:n or 0:n relationship)). For most code lists, the cardinality is 1:1, and this is the default when creating a code list.
Please see below an example of a 1:1 relationship (Example 1). The code list of this question has several categories, including categories ‘Don’t know’ and ‘Prefer not to say’ assuming that there is an answer to the question. The option of answers to the question is also limited to appearing once as the code list is populated with mutually exclusive categories. Therefore, the maximum selection of categories from the code list is limited to 1 and this is a 1:1 relationship.
Example 1 Questionnaire:Â ALSPAC - Parent COVID-19 Long Covid Questionnaire 5
Questionnaire layout:
Archivist view: (alspac_covid_q5)
Please see below an example of a 0:1 relationship (Example 2). In this example, the code list of question returns only one category. The respondent has an option of not selecting it (and answering in the textbox) or selecting that category. Therefore, this is a 0:1 relationship.
Example 2 Questionnaire:Â US - COVID-19 Wave 3 Questionnaire
Questionnaire layout:
Archivist view: (us_covid_q3)
In a ‘Tick all that apply’ answer, if a respondent doesn’t need to choose a category, cardinality is 0:n, with n the total number of categories the respondent can choose. If a ‘Tick all that apply’ code list contains the category 'None of the above' or similar, or is within a condition which assumes that there is an answer, the cardinality is 1:n, with n the total number of categories the respondent can choose, not counting the ‘None of the above’ category.
Please see below an example of a 1:n relationship (Example 3). In this example, respondent expects to choose at least one category as the code list contains ‘Don’t know’ and ‘Don’t want to answer’ responses.  Categories 1-7 are mutually inclusive, allowing respondent to choose seven answers for this question at any given time. Therefore, max responses of the cardinality is 7.
Example 3 Questionnaire:Â CLS - CLS COVID-19 Survey - Wave 2
Questionnaire layout:
Archivist view: (cls_covid_q2)