Need 3 constraint support

Hi Odk community need a support from you guys.

So we need 3 conditions here to be met:

  1. not selected that there was no door and selected that the frame was used for the door;
  2. not selected that there was no roof and selected that the frame was used for the roof;
  3. not selected a response option and selected "no"

recently i did this one "not(selected(${lat_door},'no') and selected(., 'yes_door')) and not(selected(., 'no') and not(selected(${lat_roof},'no') and selected(., 'yes_roof') and count-selected(.) > 1))"

but its not working.
your help will be really apricated.
thanks

Infra_quality_latrine.xlsx (17.9 KB)

That is close. The first two conditions are correct:

not(selected(${lat_door},'no') and selected(., 'yes_door')) and not(selected(., 'no') and not(selected(${lat_roof},'no')

The third and final condition should be not(selected(., 'no') and count-selected(.) > 1), so that it is not the case that "No" is selected and there is more than one item selected. All together, it is:

not(selected(${lat_door},'no') and selected(., 'yes_door')) and not(selected(., 'no') and not(selected(${lat_roof},'no') and not(selected(., 'no') and count-selected(.) > 1)
1 Like