Data validation criteria messed up by "999"

Hello everyone,

I’ve run into a problem with validation criteria. Here’s the set of questions:

  1. How many people slept in this household last night? [slept_people}
  2. How many pregnant women slept in this household last night? {slept_pregnant]
  3. How many children under the age of 5 slept in this household last night? [slept_child]

Here are the validation criteria for the 3 questions. The criteria I’m struggling with is for question #3.

  1. None
  2. . <= ${slept_people} or (.= 999)
  3. (.<=${slept_people} and . <= (${slept_people}-${slept_pregnant})) or (.=999)

My problem is: if someone declines to answer only question #2 about pregnant women (so data collector types “999”), then for question 3 they cannot enter anything (since slept_people - “999”) is a large negative number. What I’m trying to figure out is how to write criteria to say “…less than [slept_people]-[slept_pregnant], UNLESS [slept_pregnant]=999…then this criteria does not apply.”

Many thanks in advance for any help!

Alysse

Hi @amaglior,

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

In the survey tab of your xlsform:

Data entry screen as seen in Enekto: wrong entry

Data entry screen as seen in Enekto: acceptable entry

Data entry screen as seen in Enekto: acceptable entry

Reference xlsform:

Constraint 2020 07 24.xlsx (9.6 KB)

Have a great day!

1 Like

Hi @Kal_Lam thanks for the response. Unfortunately (unless I’m misunderstanding) that still doesn’t solve the problem…that display logic is what I have currently. The situation I’m referring to is if someone puts: ‘5’ for [slept_people] , ‘999’ for [slept_pregnant] , and then puts ‘1’ (or ‘2’ or ‘3’ or any number under 5) for [slept_child]. Since pregnancy can be a sensitive thing to ask about where we are surveying, it’s likely that some people may not want to answer how many pregnant women slept in the household, but will be fine answering how many children slept in the household.

Thanks!

Hi @amaglior,
Just from your explanation, I have a feeling this is a standard household listing questionnaire mostly applicable for malaria net use studies. If that is the case, I would suggest a different workaround for your questionnaire where the three parameters are not entered directly by the interviewer but rather through a different form design where the calculation is done directly from the household roster. Can you please send your XLS form I have a look at it and recommend an alternate solution?

Stephane

1 Like

@stephanealoo Thank you so much for your response. Yes, this is a malaria survey. Unfortunately, we have already started data collection and are just now finding this bug. So, we can’t really change the way the data is collected. Any thoughts on ways to alter the data validation criteria to keep the questions the way they are?

Hi,
You may have to introduce an intermediate variable (dummy to account for 999 in Q2 i.e. ${slept_pregnant} create a dummy calculate question

${dummy_slept_pregnant} which is equal to
if(${slept_pregnant}=999,0,${slept_pregnant})

Then use the dummy in the calculation instead

(.<=${slept_people} and . <= (${slept_people}-${dummy_slept_pregnant})) or (.=999)

1 Like

Hi again @stephanealoo Thanks again.

I’m confused about what a dummy variable is - is it something that shows up in the data collector-facing survey? I’ve never done a dummy variable before, if you could provide a little more context I would appreciate it! Thank you.

No
Just create a calculate question and the interviewer will not see it

@stephanealoo Can you walk me through exactly how to do that? Thank you!!

Hi @amaglior,

Kindly follow the instructions what @stephanealoo has outlined:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: (wrong entry)

Data entry screen as seen in Enketo: (correct entry)

Reference xlsform:

Constraint 2020 07 24 (Dummy Variables).xlsx (9.7 KB)

Have a great day!

1 Like