I am downloading data using the xls export type and XML values and headers. If I open these in excel all the values are General type. When I import the excel to SAS all the variables import as strings. Is there a way to export the data from kobotoolbox as numeric where applicable and also as string where applicable?
@cp622, kindly please be informed that KoBoToolbox does not directly support data exports to SAS but you could first export your data to SPSS and then import the SPSS data format to SAS. Maybe this should solve your issue.
Thank you for your reply.
I suppose I am unsure where the format is set. Are all variables output from kobotoolbox formatted as string?
@cp622, try using the
XLS (Legacy) format. That format should be able to separate
I tried the legacy format but because I will potentially be downloading data for the next year the warning that comes up with the legacy format (This export format will not be supported in the future. Please consider using one of the other export types available.) makes me think I should not use this.
Also some variables, such as dates, had the date format, but other data inconsistently had string or numeric assigned to is and I cannot see the pattern.
I can convert all the string data to numeric, I just thought there might be a feature from kobo that I am missing, but it appears the string format is assigned to all variables being exported from kobo.
@cp622, we do have this issue in our GitHub (which you should be able to follow it here):
Thank you @Kal_lam, seems other users would like formatting options, maybe kobotoolbox will develop this as an option in the future
We use normal xlsx download with XML values (plus SPSS labels download.)
Plus scripts for type conversion (and other ajustments) in SPSS, like ALTER TYPE varnameA TO varnameZ (A = F8).
For some types conversion (per column) can also be done in Excel before SPSS import, using menu Data > Text to columns.
See also previous discussion in the forum: https://community.kobotoolbox.org/t/problems-converting-data-from-csv-to-spss/18695/12?u=wroos
Sorry I missed this communication. Thank you for the link to previous thread,
I have now converted all variables to numeric where applicable via SAS.
In general csv is the best way to get data into SAS however due to our form design with repeat groups which export to separate sheets in xlsx, we download from kobo xls.
I thought kobo would take formatting from the xlsform to export data but it seems it doesn’t.
My issue has been resolved outside kobo but took me a bit more coding than I wanted