Kobo2stata

Hi there
I am using following logic to import raw data:
kobo2stata using “C:/mydata/kobosurveydata.xlsx”, xlsform(“C:/mydata/aDyQEvcRVs9re5L.xls”) surveylabel(“Label::English”) choiceslabel(“Label::English”)
But it works for a excel file having only one sheet. If you look at the attached picture “Loan_group” is for questionnaire in the LOOP and other is not. I want to import the data from “Survey Round-03” first then “Loan_group”. Could you please suggest what should I need to change in the kobo2stata logic?

@kalendra2019, linking this post from @FSg which should help you solve your issue:

Hi kalendra2019,

Thanks for using kobo2stata.

kobo2stata can handle Excel raw data with multiple sheets. The .dta equivalent of each sheet will be saved in the location where the original Excel file is saved. This save location is also presented in Stata’s results window after you execute the command.

The only specification of kobo2stata in which this will not happen is when you use the “usenotsave” option. As stated in the kobo2stata help file, “this will load the imported dataset into Stata‘s active memory rather than saving to drive. Please note this option is not recommended for (hierarchical) Kobo datasets with multiple tabs in the raw data file -for these, only the last tab would be loaded to memory.”

1 Like

Thank you @FSg and @Kal_Lam
I have used this syntax:

kobo2stata using “Survey_Round-03 rawdata.xlsx”, ///
xlsform(“Survey_Round 3 ODK.xlsx”) ///
surveylabel(“label::English”) choiceslabel(“label::English”) dropnotes usenotsave

to import raw dataset stored in “Survey_Round_03 rawdata” which has two sheets, first one is “Survey Round_03” and second one is “Loan_group”. But, while I ran the above syntax it only imports the data from second sheets “Loan_group”. What I meant in the previous question was is there any way to import the data from first sheet “Survey Round_03” and then “Loan_group”?

I have tried the following syntax but it has not been working:

kobo2stata using “Survey_Round-03 rawdata.xlsx”, ///
xlsform(“Survey_Round 3 ODK.xlsx”) ///
surveylabel(“label::English”) choiceslabel(“label::English”) sheet(“Survey Round_03”) dropnotes usenotsave

Looking forward to hearing from you soon.

Remove the “usenotsave” from your command specification.

1 Like

But it still gives an error sms as:

sheet() is not an option of the kobo2stata command - please check the kobo2stata help file where all available options are listed. There is no need to specify a sheet. The .dta equivalent of every sheet found in the raw data file will be saved in the location where the original Excel file is saved. This save location is also presented in Stata’s results window after you execute the command successfully.

1 Like

I got your point and it works now.
Thank you!

1 Like

@FSg, :clap: :heart: :partying_face: