Categorizing respondents into cohort after data is collected

I have a course evaluation survey that we are repeating for each iteration of the course: Cohort 1, cohort 2, cohort 3, etc. Students don’t know what cohort they are in, but I can tell based on the date they submitted the survey (e.g. March 2026= cohort 1, May 2026=cohort 2, July 2026 =cohort 3, September 2026=cohort 4…)

Is there a way to group by cohort (or month submitted) in the Report function? Ideally this would be for data already collected, but I could add a variable so at least we have it going forward.

I can easily export the data and create a cohort variable in Excel, Stata, etc. It would just be helpful to look at the report inside KoboToolbox as data is coming in.

Yes, you can ‘dis-aggregate’ the data in the Report using the Group by function. For example, if this is my raw data for District (ungrouped)

I can choose to disaggregate the report based on another field, say, Sex

producing

In terms of disaggregating your data based on a cohort, you’ll probably need to define a new question/calculation in your form to generate the necessary discrete cohort range(s) based on the date. But since submission_time field isnt actually available within the form itself - it is only added by the Kobo server when the submission is received - you will need to determine the Cohort based on something else. But hopefully you have the start_time, end_time or today metadata options already enabled in your form (?), in which case you can use these to calculate the cohort in your form instead of submission_time.

And once you have the cohort value, you can disaggregate your report on this field, as described above.

[Note, end_time is strictly set when he form is finalized, which may happen some time before it is actually submitted, especially if it was collected out in the field. And today is set when you first begin the form, which again may not strictly match when it was actually completed and submitted. Which is to say, these fields are only approximations to the actual submission_time itself, but hopefully the difference isn’t critical to your needs]

2 Likes

Thanks for this.

I understand the “Group by [sex]” approach but didn’t think to include the needed variable when I collected the first 2 cohorts, so that is not an option.

I do have start_time and end_time. But I think the calculation needs to be added before data is submitted, not after, right? So my first 2 cohorts won’t have cohort data but I can add it for subsequent cohorts?

Correct. At present in the Kobo report builder you can only disaggregate based on visible questions, but not calculation results. But you can always include a read_only select_one question to expose your computed disaggregation field - eg cohort - and then use this in your report.

For example, the following form computes your cohort based on a date-of-birth range: before 2000 (A), 2000-2010 (B), 2010-2020 (C), after 2020 (D)

Disaggregation.xlsx (18.7 KB)

Note the cohort calculation itself is not available for disaggregation, but the followup visible show_cohort select_one question is. This gives the desired result to disaggregate “Do you have any children” based on date of birth.

[BTW you can also stick the calculation directly on the select_one instead. I did a separate explicit calculation to illustrate the difference. Make it read_only so the user cannot override the computed cohort].

If you have already collected some data then obviously any existing records wont have the new cohort field populated, so you may need to go back in and manually edit these old records to add it back in.