Relation between calculation, relevant, constraint and required

Hello Experts,
How are relevant and constraint and required working together with calculation and with a calculate type?

  1. Does a relevant filter a calculate type? Or is the result only hidden?
  2. Does a constraint have any effect with a calculate type? (e.g. system error?)
  3. Does a constraint restrict a calculation for another type)?
  4. Does a required influence a calculation?
  5. Does a required influence a calculation for another type)?
  6. Can a calculation be combined with manual entry in the same variable?

A table would be helpful (behavior for the combination in the cells)

                         |   Relevant  |  Constraint |  Required | 

calculate type

calculation for another type

Hopefully, there is no difference between KoBoCollect and Enketo.
Thanks a lot in advance.

Hi @wroos,

I have come up with a small workaround to answer your questions:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo:

Reference xlsform:
calculate calculations test.xlsx (10.7 KB)

Now back to your queries:

Looking at the workaround shared above the relevant worked when the criteria was met.

Did not see any effect of constraint or constraint_message.

Sorry did not understand the question. Maybe we could again deal with it if you could provide a suitable example to make it clear.

Did not see any effect of required with the calculate question type.

Sorry did not understand the question. Maybe we could again deal with it if you could provide a suitable example to make it clear.

Correct me if i understood you wrongly, but the calculation along with a calculate question type is a question type that performs at the background hence the same that you have outlined should not be possible.

Have a great day!

Dear @Kal_Lam,
thanks, so far.
3, 5. and 6. means using a calculation with another type like integer.
Together with read only we use this is an option to show calculation results in the UI, for example a calculated date (instead of a note).
I am also looking for more rules in the specifications about calculation & calculate types
Kind regards

Hi @wroos,

Getting back with query 3 and 5:

For this i have made a slight change in the survey tab of the xlsform as outlined below:

Data entry screen as seen in Enketo for query 3:


Yes a constraint should restrict a calculation if you have mixed it with an integer question type.

Data entry screen as seen in Enketo for query 5:


Yes a required should influence a calculation if you have mixed it with an integer question type.

Reference xlsform:
calculate calculations test.xlsx (10.8 KB)

Sorry was still not able to understand query 6.

Additional, the constraint or the required should also be affected by the read_only. The only thing the read_only restricts is that it does not let you entering anything in the form.

Have a great day!

1 Like