You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/choice_filters_xls.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ To add static choice filters in XLSForm:
28
28
- This value will act as the filter. It can be any word or number.
29
29
4. In the `survey` worksheet, add a **choice_filter** column. This column will contain the **choice filter expression** used to filter the option choices.
30
30
- The choice filter expression in its most basic form will take the format: **filter = ‘value’.**
31
-
- For example, **q2 = ‘yes’** will retain all choices with **yes** in the `q2` column.
31
+
- For example, `q2 = ‘yes’` will retain all choices with **yes** in the `q2` column.
32
32
33
33
### Example
34
34
@@ -68,8 +68,8 @@ To add dynamic choice filters in XLSForm:
68
68
- It can be helpful to name this column the same as the **parent question.**
69
69
3. In the filter column, enter the **name of the choice** from the parent list that each option in the child list corresponds to.
70
70
4. In the `survey` worksheet, add a **choice_filter** column. This column will contain the **choice filter expression** used to filter the option choices.
71
-
- If the parent question is `select_one`, the choice filter expression will be **filter_column = ${question_name}**, where `question_name` refers to the parent question.
72
-
- If the parent question is `select_multiple`, the choice filter expression will be **selected(${question_name}, filter_column).**
71
+
- If the parent question is `select_one`, the choice filter expression will be `filter_column = ${question_name}`, where `question_name` refers to the parent question.
72
+
- If the parent question is `select_multiple`, the choice filter expression will be `selected(${question_name}, filter_column)`.
73
73
74
74
When a respondent selects an option in the parent question, the choice list for the child question will be filtered to only include the corresponding choices.
75
75
@@ -82,7 +82,7 @@ In the example below, `continent` is the **parent question** and `country` is th
| select_one country | country | Country | continent = ${continent} |
85
+
| select_one country | country | Country |**continent = ${continent}**|
86
86
| survey |
87
87
88
88
**choices worksheet**
@@ -102,7 +102,7 @@ In the example below, `continent` is the **parent question** and `country` is th
102
102
You can create more advanced choice filters by using logical operators, mathematical operators, functions, and regex in your choice filter expressions. This allows for highly customized and precise filtering of options, tailoring the form to specific data collection requirements and respondent characteristics.
103
103
104
104
<pclass="note">
105
-
<strong>Note:</strong> In advanced choice filter expressions, the `name` column of the `choices` spreadsheet can be used as a filter column.
105
+
<strong>Note:</strong> In advanced choice filter expressions, the <code>name</code> column of the <code>choices</code> worksheet can be used as a filter column.
106
106
</p>
107
107
108
108
Examples of advanced choice filter expressions in XLSForm include:
@@ -161,7 +161,7 @@ In the resulting form, `Q2` will display only the options chosen in `Q1`, as sho
161
161
162
162
<details>
163
163
<summary><strong>Duplicate option names in a list</strong></summary>
164
-
If your choice list includes duplicate option names (for example, if the same neighborhood name is present in different cities), <ahref="https://support.kobotoolbox.org/form_settings_xls.html">enable choice duplicates</a> in the `settings` worksheet by setting <code>`allow_choice_duplicates`</code> to <code>`yes`</code>.
164
+
If your choice list includes duplicate option names (for example, if the same neighborhood name is present in different cities), <ahref="https://support.kobotoolbox.org/form_settings_xls.html">enable choice duplicates</a> in the <code>settings</code> worksheet by setting <code>allow_choice_duplicates</code> to <code>yes</code>.
0 commit comments