Hello Everyone!
Please, by the way, I have an Excel file that I would like to read with CSPro it is the data of the administrative division of my country in the attached excel file.
So I would like to make sure that when I choose a region, CSPro only displays the departments, subprefectures and villages of this region.
I know how to do this manually on CSPro with the function "setvalueset (variable_name, Value_set_name)", but this time the data is in a rather large Excel file and I think it's quite difficult to do it manually.
I will be very grateful to you forhelping me.
Thanks !
Value set name and value label from External file (Excel)
Value set name and value label from External file (Excel)
- Attachments
-
- draft.rar
- (1.98 MiB) Downloaded 244 times
Re: Value set name and value label from External file (Excel)
You can do this using a lookup file. Use the Excel2CSpro tool to generate a dictionary and data file from your spreadsheet. Then you can use loadcase to lookup the subprefectures for the chosen department and make a value set from them using the version of setvalueset that takes an array of codes and an array of labels.
See chapter 5 in this document: http://www.csprousers.org/resources/CSP ... rkshop.pdf for a more detailed explanation. You can download the working example from here: http://www.csprousers.org/resources/CSP ... erials.zip
A more complex example that handle multiple levels of geography is attached to this post.
See chapter 5 in this document: http://www.csprousers.org/resources/CSP ... rkshop.pdf for a more detailed explanation. You can download the working example from here: http://www.csprousers.org/resources/CSP ... erials.zip
A more complex example that handle multiple levels of geography is attached to this post.
- Attachments
-
- Census Data Entry (cascading value set).zip
- (24.89 KiB) Downloaded 280 times
Re: Value set name and value label from External file (Excel)
Thanks Josh ! It’s rather on chapter 6 that they talk about look up file. Thanks again !