# Running total constraint calculation

I have a section of a survey 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 the CommCare platform. A sample Excel file of the above described loop is attached.

Thanks!
Justin

land_use_loop_example.xlsx (50.1 KB)

Hi Justin,

Yaw

ยทยทยท -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Thu, Jun 16, 2016 at 4:49 PM, justin.mullikin@oneacrefund.org wrote:

I have a section of a survey 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 the CommCare platform. 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 "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.