syncing all variables

22 views
Skip to first unread message

Jitka Hiscox

unread,
Apr 27, 2013, 12:55:41 PM4/27/13
to kobo-...@googlegroups.com
Hi all,
I'm trying to figure out how to get all of the variables to download, even if they were not populated during the administration of the survey. As it is, when the instances are being converted to a .csv, only the fields that are populated with values in the form get converted  - meaning that if I have 5 instances and none of them has answered question A05, question A05 will not appear in the .csv.
 
I thought about populating the variables with default values for integer/text questions, but I'm not sure how to get all of the multi-select options to show up in my csv.  Has anyone done this? If yes, would you be willing to share your .xml file so I could see what the .xml code looks like?
 
Jitka

Neil Hendrick

unread,
Apr 27, 2013, 1:57:02 PM4/27/13
to kobo-...@googlegroups.com
The thing I usually do is create a fake record in which I select all possible answers. When aggregated to CSV, you get a file with fields for all options. You can delete the fake record, and leave the CSV shell. The next time you aggregate real data, as long as the folder settings are the same for where the CSV is stored, it will write the new data into the old CSV, and there will be columns for every variable, even if those variables are NULL.

~Neil


Tino Kreutzer

unread,
Apr 28, 2013, 3:38:10 PM4/28/13
to kobo-...@googlegroups.com
Similar to Neil's suggestion, you can actually just save a CSV file in your sync folder but without adding any values. This will also allow you to permanently set the order of columns in your resulting CSV and spreadsheet. 

Just add all the column headers, comma-separated, into the first line and create a line break, but keep the second line empty. (You'll have to do this in notepad or similar program.) Then just save it in the sync folder under the same name the CSV would normally have. KoBoSync/Form will then just append the new records starting with row 2, but keeping both the order intact and leaving all variables as separate columns. Just remember to create a line break at the end of the first line.

For example, your csv file should look like this:
[line 1] instance,deviceid,key,start,end,A01,A02,A03,...
[line 2] 

As an example I'm attaching a file that does that. 

On Sat, Apr 27, 2013 at 5:57 PM, Neil Hendrick <Neil.H...@kobotoolbox.org> wrote:
The thing I usually do is create a fake record in which I select all possible answers. When aggregated to CSV, you get a file with fields for all options. You can delete the fake record, and leave the CSV shell. The next time you aggregate real data, as long as the folder settings are the same for where the CSV is stored, it will write the new data into the old CSV, and there will be columns for every variable, even if those variables are NULL.

~Neil


--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.
To post to this group, send email to kobo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/kobo-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

JURI.csv

Jitka Hiscox

unread,
Apr 29, 2013, 9:42:56 AM4/29/13
to kobo-...@googlegroups.com
Thank you all! These are great suggestions!
j
Reply all
Reply to author
Forward
0 new messages