How to make a constraint on a question basing a previous question?

I have another question to ask you if I select_one in q_1 and I want the next question must be equal Yes can’t not equal now what is the formulas. For example
Q1. How are you?
My answer 1. Fine 2. Not so good
Q2: How about your health?
My answer: 1. Good 2. Not so good
so, if I choose 1.fine in Q1, Q2 should be equal 1. Good can not equal 2. Not so good
what is the formulas in xls form

Hi @Ah_ly,

You could do the same as outlined in the image shown below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:
Image 2

Constraints seen working in Enketo:

Reference xlsform:
Constraints.xlsx (50.7 KB)

Have a great day!

1 Like

It works but when I select 2. not so good and I

can not select 2.Not so good in Q2 also.

Hi @Ah_ly,

Try this out and it should work now:

In the survey tab of your xlsform:

Constraints seen working in Enketo:

Reference xlsform:
Constraints.xls (25 KB)

Have a great day!

3 Likes

So great it work now. Thanks so much for helping me.

1 Like

This was super helpful! Tears of joy flowing down my cheeks.