Why are repeats exported as separate CSVs/sheets?

Hello Everyone!

I am new to KoboToolbox and I have an aesthetics question for export. Currently, my survey has 4 groups, two of which are repeating groups. Ideally, upon exporting as an XLS, I would like the data from all three groups to appear on the same sheet in the Excel document. However, currently, the data from each group appears on a different sheet in the Excel doc (see pic below). I am using a Kobo server and aggregator to download and export the data.

I suspect that the groups appear on different sheets because they are different lengths. "Recipientes_de_Agua" and "RECEP" are repeating groups, with "RECEP" nested within "Recipientes_de_Agua". "Recipientes_de_Agua" repeats unlimited times based on the data collector. "RECEP" repeats conditionally in response to a previous question.

I am planning on using R to analyze my data. It would make things easier if all of my data were on one sheet in my Excel doc. Is there any way to do this? I apologize in advance if my explanation isn't clear. I'm fairly new to ODK as a whole and am not too sure about the proper terminology for things.

Thank you in advance!

Although Kobo uses a lot of ODK components, please note that its server is different.

Repeats let you capture a variable number of records within the same context. You can think of a repeat as a nested subform and the data it collects as a separate data table. Because the number of repeat instances that will be collected can vary between form submissions and the number of fields in a repeat can be large, repeats are typically exported as their own tables, as you've experienced.

I recommend reading the tip at https://docs.getodk.org/form-logic/#repeating-questions for alternatives to using repeats that you may find more convenient.

In R, you should be able to use the keys that the repeats expose to join them back to their parent context. You can flatten all into one table if you would like. I don't have an R example readily available for you but this Python example may give you ideas.

2 Likes

@LN

Thank you very much for the information! This is very helpful :slight_smile:

1 Like