I have a form that has a question asking about the total number of upper floors and lower floors in a building. So If a building has 4 floors and 2 underground floors then the enumerator should enter 4 in the upper floor question and 2 in the lower floor question.
Then the enumerator should list the units/households in each floor. So for each unit, I created a repeat. Inside each repeat, the enumerator should put the floor number of the unit that he is interviewing. So for unit number 1, the floor could be 1, the unit number 5, the floor could be 2 etc.. However, it is possible that the unit exist in a floor that is underground, so for unit number 6, the floor is -1.
I want to put a constraint that compares the sum of the upper and lower floors (4+2 = 6 in the above example) and the sum of the max of the floors that the enumerator entered in the repeat. So in the above example, if the enumerator entered the info for units in floor 2 and floor -1, then we should add 2 + 1 = 3 and compare 3 to 6. Since they are different then a message should appear that the enumerator didn't visit all the floors.
How can I do that?
Thanks
Edit: I added a screenshot of the form