Select 5 oldest youth

I'm trying to code a survey where we ask for the names of up to 15 household members. We only want to ask questions about schooling for the oldest 5 children if there are more than 5.

Currently we have calculations that determine if the child is between 5 and 18. But so far I cant figure out how to limit the survey to the 5 oldest if there are more than 5 children in the household.

We currently are coding it using the hh roster ID but that potentially changes for each survey - depending on the order the enumerators enters the children.

I think I know how I can get it to "count" for only 5 entries - but not sure how to make those the 5 oldest.

Any tips and or suggestions.

Attached is an example. Note that in the real survey file the "Child" repeats 15 times.

Example.xlsx (167 KB)

Here is an example.

Note that the XML file needs to be hand-edited after it is generated to
replace the <output...> directive that specifies the attendee's name with a
relative-path expression (line 94 of the file)

I have a number of extra text fields that could be changed to calculate
fields (and not displayed). The integer fields can be left as-is and the
prompts for them deleted from the XML file. Or you can replace them with
calculate fields and whenever you reference them wrap the reference in
int() to convert the string value to an integer value.

NBiggestOfSet.xls (31.5 KB)

NBiggestOfSet.xml (5.77 KB)

ยทยทยท On Tue, Nov 10, 2015 at 2:16 AM, wrote:

I'm trying to code a survey where we ask for the names of up to 15
household members. We only want to ask questions about schooling for the
oldest 5 children if there are more than 5.

Currently we have calculations that determine if the child is between 5
and 18. But so far I cant figure out how to limit the survey to the 5
oldest if there are more than 5 children in the household.

We currently are coding it using the hh roster ID but that potentially
changes for each survey - depending on the order the enumerators enters the
children.

I think I know how I can get it to "count" for only 5 entries - but not
sure how to make those the 5 oldest.

Any tips and or suggestions.

Attached is an example. Note that in the real survey file the "Child"
repeats 15 times.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com