Running total validation

I have a section of a form which asks about plots of land and how they’re
being used. The respondent says they have x number of plots and then the
form loops through a set of questions about each of them, including the
size (area) of the plot in ares, what crops are grown on that plot, and the
area of each crop. I can set a calculation for each crop to make sure it
doesn’t exceed the area of the plot and then another calculation at the end
of the loop to make sure total crop area doesn’t exceed the total plot
area.

Ideally, I’d like the form to keep a running total of the crop area and
notify the enumerator when the area of crops has exceeded the size of the
plot. Any ideas how I might go about this? I’m currently building this form
in Excel and then converting it to XML for upload into CommCare. A sample
Excel file of the above described loop is attached.

Thanks!
Justin

land_use_loop_example.xlsx (50.1 KB)

Justin,

Have you tried adding a validation condition to each individual area
question in the repeat that checks the sum of these areas (similar to what
you mentioned at the end of the loop)?

You could also add a label to each repeated group that only appears if the
area sum has been exceeded (same calculation) (which could possibly block
proceeding).

-Will

··· On Thu, Jun 16, 2016 at 9:46 AM, wrote:

I have a section of a form which asks about plots of land and how they’re
being used. The respondent says they have x number of plots and then the
form loops through a set of questions about each of them, including the
size (area) of the plot in ares, what crops are grown on that plot, and the
area of each crop. I can set a calculation for each crop to make sure it
doesn’t exceed the area of the plot and then another calculation at the end
of the loop to make sure total crop area doesn’t exceed the total plot
area.

Ideally, I’d like the form to keep a running total of the crop area and
notify the enumerator when the area of crops has exceeded the size of the
plot. Any ideas how I might go about this? I’m currently building this form
in Excel and then converting it to XML for upload into CommCare. A sample
Excel file of the above described loop is attached.

Thanks!
Justin


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

Hi Will,

Yes! That works. It’s not quite as elegant as I would like because I have a lot of crop iterations but it will do!

Justin

··· -- TUBURA | One Acre Fund, Rwanda +250 (0)78 433 6281 www.oneacrefund.org

On Jun 16, 2016, at 16:56, William Pride wpride@dimagi.com wrote:

Justin,

Have you tried adding a validation condition to each individual area question in the repeat that checks the sum of these areas (similar to what you mentioned at the end of the loop)?

You could also add a label to each repeated group that only appears if the area sum has been exceeded (same calculation) (which could possibly block proceeding).

-Will

On Thu, Jun 16, 2016 at 9:46 AM, <justin.mullikin@oneacrefund.org mailto:justin.mullikin@oneacrefund.org> wrote:
I have a section of a form which asks about plots of land and how they’re being used. The respondent says they have x number of plots and then the form loops through a set of questions about each of them, including the size (area) of the plot in ares, what crops are grown on that plot, and the area of each crop. I can set a calculation for each crop to make sure it doesn’t exceed the area of the plot and then another calculation at the end of the loop to make sure total crop area doesn’t exceed the total plot area.

Ideally, I’d like the form to keep a running total of the crop area and notify the enumerator when the area of crops has exceeded the size of the plot. Any ideas how I might go about this? I’m currently building this form in Excel and then converting it to XML for upload into CommCare. A sample Excel file of the above described loop is attached.

Thanks!
Justin


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


You received this message because you are subscribed to a topic in the Google Groups “commcare-users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/TMkYu9_1bmg/unsubscribe https://groups.google.com/d/topic/commcare-users/TMkYu9_1bmg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-users+unsubscribe@googlegroups.com mailto:commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.