Implementing large calculation inside multiple repeating group slows the app

We are collecting data for household. We need to ask mother and father
question for each family member. The family member is a questionnaire
roster with multiple questions. The family member is asked inside a
repeating group which is repeated using family member count entered by the
user. The household is also inside a repeating group called building and
there can be multiple buildings in a single record.

Here is how I have implemented the father and mother question:

  • I have 50 calculation field to calculate the name of each member. This
    calculation is inside the household repeat just after the family member
    repeating group end. To calculate I use indexed-repeat to calculate the
    name of each member.
  • I use this calculated value in the choices sheet for mother and father
    question (Single select)
  • I use minimal in the appearance field for the question.

Before adding this calculation and question the survey form is working
well. But after implementing these calculation and question the survey form
is not working properly. There is lag in transaction period in some
questions. The lag significantly increases with addition of family members.

Is there a better way to implement this question.

We are collecting data for household. We need to ask mother and father
question for each family member. The family member is a questionnaire
roster with multiple questions. The family member is asked inside a
repeating group which is repeated using family member count entered by the
user. The household is also inside a repeating group called building and
there can be multiple buildings in a single record.

Here is how I have implemented the father and mother question:

  • I have 50 calculation field to calculate the name of each member. This
    calculation is inside the household repeat just after the family member
    repeating group end. To calculate I use indexed-repeat to calculate the
    name of each member.
  • I use this calculated value in the choices sheet for mother and father
    question (Single select)
  • I use minimal in the appearance field for the question.

Before adding this calculation and question the survey form is working
well. But after implementing these calculation and question the survey form
is not working properly. There is lag in transaction period in some
questions. The lag significantly increases with addition of family members.

Is there a better way to implement this question.

··· On Sunday, January 24, 2016 at 3:51:09 PM UTC+5:45, Pujan Poudyal wrote:

Heavily nested repeat groups are problematic.

Can you split the form into just households?

And fill in a new form for each household in the building?

And buildings could be identified with a barcode on a sheet of paper that
the data collector scans as they go from household to household.

The indexed-repeat() expression is extremely expensive. Especially for
4-deep repeats such as you describe.

Using relative XPath addressing with . or ../ or current()/../ is going to
be much faster.

Also, keep in mind that all the data for a survey must be kept in memory.
If you are surveying an area with dozens of buildings each with dozens of
households, that is a huge amount of information to hold in an Android
device's memory.

For those reasons, it is best to avoid repeat groups for buildings and
households, and use different forms for each household.

··· On Sun, Jan 24, 2016 at 7:33 PM, Pujan Poudyal wrote:

On Sunday, January 24, 2016 at 3:51:09 PM UTC+5:45, Pujan Poudyal wrote:

We are collecting data for household. We need to ask mother and father
question for each family member. The family member is a questionnaire
roster with multiple questions. The family member is asked inside a
repeating group which is repeated using family member count entered by the
user. The household is also inside a repeating group called building and
there can be multiple buildings in a single record.

Here is how I have implemented the father and mother question:

  • I have 50 calculation field to calculate the name of each member. This
    calculation is inside the household repeat just after the family member
    repeating group end. To calculate I use indexed-repeat to calculate the
    name of each member.
  • I use this calculated value in the choices sheet for mother and father
    question (Single select)
  • I use minimal in the appearance field for the question.

Before adding this calculation and question the survey form is working
well. But after implementing these calculation and question the survey form
is not working properly. There is lag in transaction period in some
questions. The lag significantly increases with addition of family members.

Is there a better way to implement this question.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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