Dear Forum Experts,
I am programming a form for a household survey. There are about five sections with repeat questions: Crop Production, Crop Economics under Diesel and Solar Powered Irrigation Systems, Trainings received in the past 5 years and Livestock bought with Income from irrigation farming. Normally, when the data is collected, during downloading, repeat group questions are downloaded as separate sheets and cases/respondents are only identified in such downloaded data by a variable the Kobo automatically creates as Parent Index. Most of the times, analysis of survey data requires disaggregating by some variables, which are often in the survey Identification. Manually organising the downloaded repeat group data is tedious. Is there a way to programme the form so that Survey/respondent Identification get automatically copied on repeat group questions when downloading? Further, how do I programme the form so that number of choices per survey respondent gets counted? I have had this challenge for long and would like your help. I have attached my form
Comparison of Effectiveness of Solar Powered Irrigation and Motorised Irrigation Pumps Systems.xlsx (50.0 KB)
Hi @ctmukhala,
So if you don’t want to take this extra steps, what i can suggest you to add the variables inside the groups. So you you can add a measure inside the group and refer to the identification question, and by this method you will have the identification value inside your sheet. Please see the attached file, i highlighted the some example row.
Comparison of Effectiveness of Solar Powered Irrigation and Motorised Irrigation Pumps Systems.xlsx (50.7 KB)
1 Like
Many thanks Osman. However, I can’t see what you highlighted as an example. Would you mention the specific section of the repeat group question I mentioned?
Hello @ctmukhala, how are you?
To make Survey/Respondent Identification (like respondent ID, name, location, etc.) automatically appear in repeat group data, you can reference those variables within the repeat group itself. Just add a calculate question inside the repeat, and set its calculation to the variable from outside the group, like ${respondent_id}. This way, Kobo includes that info in the repeat sheet directly during download — no manual merging needed.
For counting choices per respondent, if you mean selecting multiple options in a select_multiple question, you can use a calculate question with the count-selected() function*.
1 Like
Hi @ctmukhala,you can check the line 20. Brian already explained it in narrative.
1 Like
Many thanks. I will try it. But what will it calculate, I see the calculate column blank?
Regards,
It will not calculate anything. It will just keep the same value in the mentioned questions, Let’s say you wrote Location of the HH’s in one question and you create a measure to reference this question inside a group. So when you download the survey, you will find the location of the HH in the relevant group. It will just repeat the same answer in the mentioned question, so you don’t have to merge them after you download the data.
Many thanks Osman. This is really what I have been looking for. I am so indebted to you and everyone who has come forward to assist me on this.
Regards
Dear Osman and All,
I have tried the suggestion you provided and I am testing the form using the ODK Online Form Validator and it is telling me Error: [row : 101] Missing calculation. I don’t know if I have wrongly followed it. I attached the form. Would you help?
Regards,
FOCUS Project Household-Caregiver Survey Questionnaire.xlsx (36.0 KB)
Hi @ctmukhala,
I checked your form, and wanted to share with you the corrected form, but there some issues in the form that also need to fixed, but the problem regarding your question is, you added the referance to wrong column, The values shouldn’t be in the “label::(en)”, they need to be in calculation column. So that they won’t be displayed in the form directly but they will be displayed in the excel fiel or table view. I am attaching the example file
FOCUS Project Household-Caregiver Survey Questionnaire.xlsx (35.8 KB)
1 Like
Dear Osman,
Perfect. Each time I ask for help, I learn quite a lot from you experienced programmers. Many thanks for your untiring dedication
Regards,
1 Like
This perfectly worked. Many thanks