Sum for skipping question, Select one default and Group relevant

Dear all, I have three problems that need all of you help to fix

  1. I could not sum value for skipping question
    e.g. I have 3 questions ask about income and those 3 questions have
    parent questions.
    If Q1 answer 'yes' we will ask Q1.1 about how much money?
    If Q2 answer 'yes' we will ask Q2.1 about how much money?
    If Q3 answer 'yes' we will ask Q3.1 about how much money?
    Else, if 'no' it will skip to next question
    Then I will calculate Total= ${Q1.1} + ${Q2.1} + ${Q3.1}
    But in case among which one, both, or all question has skipped, it
    could not calculate the total. Even though I set the default value to those
    variable. It still could not calculate

  2. I want to set default for select one question based on conditions
    e.g. If Total of income >=300, ${fieldname}='yes'
    else ${fieldname}='no'
    I used this formula
    *if(${total_income}>=300, selected${select_income},'1') *This
    formula could not meet with else condition. So how can I do?

  3. I want to use relevant for group based on three conditions
    e.g. If meet with this condition below, it will show group. And else,
    it will hide. I used this formula. That is correct?
    selected(${fieldname},'0') and selected(${fieldname},'0') and
    selected(${fieldname},'0')

Thanks in advance for your responses
Best,
Lihol

Lihol,

  1. Have a default on the skipped questions to be zero. Also, adjust
    the total formula so skipped questions return 0 if blank. This is
    untested, but it'd be something like:
    if(string-length(${q1})=0,'0',${q1})

  2. Test to make sure, but I don't think you can set conditional
    defaults in Collect. You can store conditional values though. Put a
    calculate on $fieldname: if(${total_income}>=300,'yes,'no')

  3. If you want the group to show if all three are true, then yes, that
    will work.

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 30, 2016 at 10:28 AM, Srou Lihol sroulihol@gmail.com wrote:

Dear all, I have three problems that need all of you help to fix

  1. I could not sum value for skipping question
    e.g. I have 3 questions ask about income and those 3 questions have
    parent questions.
    If Q1 answer 'yes' we will ask Q1.1 about how much money?
    If Q2 answer 'yes' we will ask Q2.1 about how much money?
    If Q3 answer 'yes' we will ask Q3.1 about how much money?
    Else, if 'no' it will skip to next question
    Then I will calculate Total= ${Q1.1} + ${Q2.1} + ${Q3.1}
    But in case among which one, both, or all question has skipped, it
    could not calculate the total. Even though I set the default value to those
    variable. It still could not calculate

  2. I want to set default for select one question based on conditions
    e.g. If Total of income >=300, ${fieldname}='yes'
    else ${fieldname}='no'
    I used this formula if(${total_income}>=300,
    selected${select_income},'1')
    This formula could not meet with else condition. So how can I do?

  3. I want to use relevant for group based on three conditions
    e.g. If meet with this condition below, it will show group. And else, it
    will hide. I used this formula. That is correct?
    selected(${fieldname},'0') and selected(${fieldname},'0') and
    selected(${fieldname},'0')

Thanks in advance for your responses
Best,
Lihol

--

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.