In this article
The Question ID is the survey-unique ID of the form (questions). This is an automatically generated, alphanumeric string with no white space, starting with a letter. You may replace the system-generated ID with your own. Note that the maximum length for question IDs is 50 characters.
Important
Do not use reserved keywords as question IDs (go to APPENDIX C: RESERVED KEYWORDS for more information).
The data is stored in the database with variable names constructed in the following fashion:
- Single - One column with a tag identical to the question id, and with answer codes as contents.
- Open - One column with a tag identical to the question ID, and the answer text is the content.
- Multi - One column per answer alternative. The tag equals the question id_code of the answer alternative. The contents are either 0 (not selected) or 1 (selected). For Open Text Multi questions the contents will be the entered text. For Ranked and Numeric Multi questions the contents will be the number answered.
- Grid - A column for each sub question (answers). The tag equals the question id_code of the answer alternative. The contents are the codes of Scales.
- Other - “Other: specify” in single, multi or grid questions is represented in data files in the following way: The tag equals question id_code_other. The contents will be the answer text.
Avoiding Unnecessary Issues
To avoid unnecessary issues a number of points should be noted:
You do not have to change the default ID of a form, even if you introduce the form between other existing forms (for example at a late stage of the Survey construction). If you do change the ID, be very careful to give it a unique ID! For example, if you introduce a new form between forms q5 and q6, where q5 is a multiple question, do not label the new form q5_2 as this will already be the code for the second alternative in the original question q5.
If the survey uses the Optimized Database format (go to Optimized Database Format for more information), then the use of the underscore character (_) in question IDs and codes is restricted.
If you change a question ID when the survey is live, a new column is created in the database. However the old column will remain with its original name and any data that was gathered up to the point of the ID change. If a survey has been previously launched to production then it is not recommended to later reuse the same question ID for a different question type, or change the case of any characters in an existing question ID. Doing this can cause problems when exporting the data because the question in the database will still exist under the previous question ID. If you intend to relaunch the survey using the Create New Database option then this is not an issue because the database is created anew.
Warning!
If you change a qid when the survey is live then any data already gathered by that question may be lost. In this event the data will not be retrievable, even if the qid change is reverted.
A question ID cannot have the same ID as a weight model in the survey. If a question ID has the same ID as a weight model used in the survey, the weight model generation will fail and an error will be generated (go to Overview for more information).
These variable names will be used as column titles when survey data is exported to SPSS Excel, or ASCII Tab separated or comma separated files. For Fixed-width ASCII files, these variable names will be used in the definition file.
Restrict the length of the ID to 8 characters if you wish to use the ID as the column-name in SPSS when exporting data to this format. For multi-questions and grids, you should try to restrict the length to 5 or 6 characters depending on the length of the codes, because column names are constructed as follows:
question id_code
and this construction will quickly use up the 8-character restriction for column names.
Use invalidResp as the qid to exclude certain records from reporting, for example if you suspect the survey respondent has just provided random answers (go to APPENDIX C: RESERVED KEYWORDS for more information). See also the separate SmartHub User Guide.
Underscore Character Limitations
When using the Optimized Database format(go to Optimized Database Format for more information), Question-IDs and codes are allowed to contain the underscore (_) character, though with some restrictions.
If the underscore is used, a situation can easily arise where the system is not able to tell whether a database field belongs to one question type or another. For example, imagine the situation: You have collected data for the Single question called 'q1_5', then the survey is edited. During the editing process, this Single is deleted and a new Multi is created with the name 'q1'. If the Multi has more than five answer options, then one of the options will automatically be given the code '5'. You then have a serious problem - existing data from the old question q1_5 will be mixed with new, different data from the new question that is also called q1_5.
For this reason, for Multi and Grid questions that use a loop reference answer list (go to Linking a Question to a Loop for more information):
- You cannot use the underscore character in the question name (the question ID).
- You cannot allow any other variables to have a question ID starting with the name of the loop reference.