Validation of user input

Hi guys, i need your help here. I need to add several responses to
questions( 2,3,4,5 below) and validate with a response to another
question(1 below).
Example:

  1. How many how people live in this house? …
  2. How many Female children below 15 years live in this
    house?..
  3. How many Male children below 15 years live in this
    house?..
  4. How many adult Males aged 15 and above live in this house? …
  5. How many adult Female aged 15 and above live in this house? …

I want to validate such that if the total number of members in Q1 should be
equal to the responses in Questions 2, 3,4,5. How do i achieve this, am
newbie in this area

Validation.docx (23.8 KB)

Martin,

Please see these docs on the sum() function
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-sum.
You could add a validation condition to the last question (or any of them
if they’re in a question list) that requires that the answer to the first
question be equal to the sum of the second through fifth questions.

Cheers,
Will

··· On Thu, Aug 4, 2016 at 4:03 AM, Martin Mutuku wrote:

Hi guys, i need your help here. I need to add several responses to
questions( 2,3,4,5 below) and validate with a response to another
question(1 below).
Example:

  1. How many how people live in this house? …
  2. How many Female children below 15 years live in this
    house?..
  3. How many Male children below 15 years live in this
    house?..
  4. How many adult Males aged 15 and above live in this house? …
  5. How many adult Female aged 15 and above live in this house?

I want to validate such that if the total number of members in Q1 should
be equal to the responses in Questions 2, 3,4,5. How do i achieve this, am
newbie in this area


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.

'Martin,

One other option would be to simply add the questions together with a plus,
as long as there is fixed number of quesitons.

You can do this by dragging each question over into the "calculate"
condition of the “cumulative_count” hidden value and placing a “+” sign in
between.

-Clayton

··· On Thu, Aug 4, 2016 at 12:55 PM, William Pride wrote:

Martin,

Please see these docs on the sum() function
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-sum.
You could add a validation condition to the last question (or any of them
if they’re in a question list) that requires that the answer to the first
question be equal to the sum of the second through fifth questions.

Cheers,
Will

On Thu, Aug 4, 2016 at 4:03 AM, Martin Mutuku martinnzioka@gmail.com wrote:

Hi guys, i need your help here. I need to add several responses to
questions( 2,3,4,5 below) and validate with a response to another
question(1 below).
Example:

  1. How many how people live in this house? …
  2. How many Female children below 15 years live in this
    house?..
  3. How many Male children below 15 years live in this
    house?..
  4. How many adult Males aged 15 and above live in this house?
  5. How many adult Female aged 15 and above live in this house?

I want to validate such that if the total number of members in Q1 should
be equal to the responses in Questions 2, 3,4,5. How do i achieve this, am
newbie in this area


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.


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.