Relevant: Integer for Another Question

Hi everyone,

I made a survey where I restrict some questions based on previous answers. For example, early in the survey I ask “how many boys ages 0-17 live in your household.” The response is an integer greater than 1. Later, I ask “how many school-aged boys ages 0-17 currently work?” The answer is meant to be restricted only to households who indicated that they had at least 1 boy age 0-17 living in the household. I used “selected(${male_0_17},’. >= 1’)” in the “relevant” column, but the survey instead just removes the question altogether. Is there a better way to do this?

Welcome back to the community @cmarin! So do you mean you have basically 2 questions that needs attention where…

Q1. How many boys ages 0-17 years live in your household?
Q2. How many school-aged boys ages 0-17 currently work?

Q2. should be popped up if and only Q1 is >=1?

Hello,
If you have an integer type you will not use selected( ), but just the greater expression. selected( ) is only used for select_multiple type (also works for select_one type)…

@Kal_Lam . Maybe it would be helpful to add a numeric example in the support article
https://support.kobotoolbox.org/skip_logic.html?highlight=relevant

1 Like

Thank you @wroos! I have marked it for the updating process.

1 Like

Hi both - thank you for the support. @Kal_Lam : correct - Q2 should pop up only if Q1 is >=1. I’ve removed the selected() but am still having difficulties, getting the error message “FormLogicError: Could not evaluate: /model/instance[1]/data/survey/male_0_17 ,.>= ‘1’, message: The expression is not a legal expression. (line: undefined, character: undefined)”. I have tried numerous iterations:
${male_0_17}, >= ‘1’
${male_0_17}, ‘>= 1’
${male_0_17}, = ‘1’

All of them give the same error message. Thanks for your help.

If it’s integer/numeric, remove the ‘…’ . This are text value delimiters.

1 Like

Thank you! Seems to have worked

1 Like