Relevant statement

1. What is the problem? Be very detailed.
I would like for a group of questions to appear if the respondent answers with a number greater than zero to an integer questions earlier in the questionnaire. i.e. they can respond to two different integer questions, and if either response is greater than zero for either question then I want a group of sub questions to appear.

2. What app or server are you using and on what device and operating system? Include version numbers.
I am using an XLS form
3. What you have you tried to fix the problem?
tried to look online on the ODK website, as well as the forum.
4. What steps can we take to reproduce the problem?
Please advise of the correct coding for the relevant statement.

I currently am using something like this when I am using text responses for a relevant statement:

for a integer do I use:

For two responses do I use:
selected(${variable_name},'>0' or selected(${variable_name2},'>0'

Please assist with the correct way to code a relevant statement for two possible integer responses to earlier questions.


See the docs section on Comparison Operators. You'll also want to read the warning (about how empty response values are not automatically converted to zero) and the next section on Boolean Operators.
Here's an example form based on your request (also pasted below):
comparisonOperator.xlsx (8.9 KB)

|    type     |      name       |         label          |           relevant           | required |
| integer     | number1         | Input a number:        |                              | yes      |
| integer     | number2         | Input another number:  |                              | yes      |
| begin_group | greaterGroup    |                        | ${number1}>0 or ${number2}>0 |          |
| note        | myNote1         | One of the numbersā€¦    |                              |          |
| note        | myNote2         | was greater than zero! |                              |          |
| end_group   | endGreaterGroup |                        |                              |          |
| note        | myNote3         | Goodbye!               |                              |          |
1 Like