In this article
Note: You can start the Template Creation wizard from two places; "Survey Data > Templates" and "Data Processing > Templates". When you start the wizard from Survey Data a project is preselected, so the Project Schema Type selection step is unnecessary. The procedures for the two wizards are therefore slightly different. The procedure described below starts from Survey Data > Templates menu.
Note: When creating a new template you can save the settings as default. The next time you click New Template, the template will then be created with the default settings you have saved. To save a template as default, check the Save Current Options As Default box in the Advanced Options dialog. See below.
- When in the Survey Data Template list, click New Template.
- Type a name for your new template into the Template Name field.
- Select the type of template you wish to use.
- Simple - allows you to define a template specifying which variable(s) should be included or excluded and in which order. This template can be created based on variables from one or several projects. A simple template does not allow you to control the specific column positions of the variables, only the order in which they are to be exported. Simple templates are ideal for exports to Excel, Delimited Text File and SPSS formats, but could equally be used for Triple-S, SAS, Fixed Width File and Quantum exports.
- Fixed Width - in addition to the capabilities of the Simple (Delimited) Template, the Fixed Width template allows column positions to be specified by assigning Start and Finishing columns or specifying the column Length. You will have access to more additional functions in the Template editor, which will allow you to change variable properties. For example: you will be able to set Bitstring or Spread to one or a group of multi variables, and you will be able to change the length of columns for one or a group of variables (for multi/ single/quantity/character only). These templates are suitable for the following exports: Triple-S, SAS, Fixed Width File and Quantum. If you use this template type for Quantum exports and the project contains loops, a Multi Trailer Card data set will be generated; otherwise a Single Card data set. If you wish to generate a Single Card data set for projects with loops, you must first flatten the project.
- Quantum - in addition to the functions available in Fixed Width templates, a Quantum template will give you two additional columns in the editor. These represent the Start and Finish Card. These are editable. If the project contains loops, a Multi Trailer data set will be generated; otherwise a Multi Card data set will be generated.
- Click Next.
- Maximum card size - specify the total number of columns on each card. The default value is 1000 ( the limit for Quantum).
- Serial length - allows you to specify the number of columns required for the serial field. This field is not visible in the template, and will be used for reserving space for the storage of serial values. The default value is 8.
- Card type length - allows you to specify the columns required for the card number field. The card number is stored on every card. The maximum allowed value is 27. The default is 2.
- Split all variables over card - when the category list of a variable exceeds the defined card size, the remaining categories will be written on the next card. The variable can therefore be split over several cards. This is the default behavior. By un-checking this option, the following happens: the template will be generated and an error will be displayed in the Error column in the template editor. This will allow you to either delete the variable or decrease the length of the variable by assigning spread (when this variable is a multi). Alternatively you can generate a new template and increase the number for the Maximum card size option.
- Make the desired selections and click Next.
- Select the project you wish to use (if the list is extensive you can use the search facility to find the desired project) and click Next.
- Schema Language - this drop-down will list all the languages available in the project you have selected above. Select the language you wish to use for the template.
- Text in Question Labels - select the type of question labels you wish to use. The options are:
- Text Only - the label element will contain only the text of the question.
- Title Only - the label element will contain only the title of the question.
- Title and Text - the label element will contain the question title followed by the question text.
- Question ID - the label element will contain the question id.
- Text in Answer Element Labels - allows you to specify whether the Answer element of a Grid / Open Text List / Numeric List Question is to be positioned in front of the Question label, after the Question label or without the Question label when exporting survey data or when generating a Survey Data Template which can be used for a survey data export. The content of the Question label depends on the Text in Question Labels setting, which allows you to specify whether you want the Question ID, Question text, Question title or Question text and Title exported. Select the text you wish to be included as the answer labels. The options are:
- Answer (Question label) - the question label is placed after the answer element.
- Question label (Answer) - the question label is placed before the answer element.
- Answer label - the answer element is placed without the question label.
- Exclude Hierarchy/Table Lookup Labels - if a question in the survey to which the template is linked is set to Hierarchy or Table Lookup, then this option becomes available. As the list of labels for hierarchy or table lookup questions in the schema file could potentially be a very long, you can check this option to exclude the list of labels from the schema file.
- Multi Questions with Loop Reference Answer List - This option is only relevant for surveys stored in optimized database format. With this setting you can specify how Multi questions using loop references are to be stored in the Template, and thereby the data structure in the survey data export.
- If you select "As Standard Multis ( flat)", the Multi question will be stored on the responseid level. If in addition you select “Split Multis in separate variables”, two logical variables will be generated (q1_1 and q1_2). Without this setting a standard Multi question will be generated. This is the same behavior pattern as for a Multi question that does not use a loop reference.
- If you select Within Loop, the Multi questions will be stored as Single questions in the loop that is used as reference.
- Multiple Format - Fixed Width and Quantum templates have this additional option. Use this to define whether you wish to use BitString or Spread:
- Bitstring - select this option to generate a Triple-S XML template for which data is recorded with one character per category of the corresponding variable. A character "1" is used to signify that a category has been selected; a character "0" signifies that a category is not selected. The category value refers to the relative position of the 0/1 code in the data field. Therefore a category value of 9 will always refer to the code in the 9th location of the data field even if some of the lower category values have not been defined. The data field length is defined by the highest category value. This means that with nine category values, nine fields in the data will be used. Using this storage type, Multi variables with long category lists will require a large data field length. In these cases you are recommended to use Spread instead. This can be selected as Multiple format when generating the template, or assigned to one particular variable or a group of variables in the Template Editor.
- Spread - select this option to generate a Triple-S XML template for which data is recorded as a series of sub-fields, each containing one category value of the variable. The data sub-field length is the minimum number of characters required to represent the largest category value in the Values block. Thus variables with category values up to 9 have a data sub-field one character long; variables with category values up to 99 have a data sub-field length of 2, etc. With this storage type it is possible to reduce the field size for multi questions, so it is recommended particularly for variables with long lists of category values. You can change this property for Multi variables in the Template Editor anytime.
- Recode Multis - [only for Fixed Width templates] Check this box to recode value codes for non-sequential multi variables. For example, a multi variable with the answer codes 1, 2, and 99 will normally use 99 positions in the export, although only three are actually required. With this setting, the variable will then use only three positions. If you have many multi variables with non sequential codes, selecting Recode Multis will greatly reduce the size of the exported file. The option selected here will be stored with the template so it can be reused when adding multis from the pool or from the project.
- Split Multis in separate variables - logical variables will be generated from each category for all Multi variables of format "BitString" in the template. For example, a Multi question q5 with 3 categories (1, 2, 99) will result in 3 logical variables (q5_1, q5_2, q5_99). These generated logical variables can be positioned in the generated survey template by moving them or by allocating specific columns.
- Flatten Template - with the flattening process, a survey template that includes loops will be simplified such that the loops are converted to a number of 'standard' variables. This means that loop data will be expanded, and variables will be created to represent each iteration of each question.
- Exclude all open questions - check this box to exclude the following question types from the generated template: Open Text, Open Text List, 'Other-specify' from answer lists, Multi questions with Open Text property selected.
- Truncate Open Ends - for Open Ends (Open Text questions with no field width specified), it is recommended to truncate texts to improve performance. If a number of characters is specified, texts longer than this limit will automatically be truncated.
- Template Default - either include all the available variables in the template or create an empty template.
- Save current options as default - saves the current settings as the default template (go to Creating a Default Template for more information), which will be created when you click the New Template button.
- Choose the desired options.
- Click Finish.
- In the Available Variables list, use standard Windows selection techniques to select the questions you wish to include in the template, then click the >> button to move the selected questions to the Selected Variables column.
- When you have selected the variables you require, click Save to save the changes.
The template Name page opens as shown below - .
Figure 1 - The template Name page
The types are:
This next step is only valid if you have selected Quantum. In this case the Punch Card Details dialog opens - . If you have selected Simple or Fixed Width, go directly to step 7 in this procedure.
Note: If you have started from the Data Processing > Templates menu, the Project Selection page now opens. Select the project on which the template is to be based, then click Next.
Figure 2- The Punch Card Details dialog
The options/properties here are:
The Advanced Options dialog opens - .
Figure 3 - The Advanced Template Options dialog
The properties and options available for Simple templates are:
Example: A survey contains a Multi question q1 using a loop reference which contains a list with 2 answers (1, 2). For further information about how to link questions to a loop, refer to Linking a Question to a Loop in the Forsta Professional Authoring documentation.
Note: Survey data that was exported using a Template generated with this option cannot be imported back into the survey.
The Variable Selection page opens as shown below - . Here you select the variables that are to be included in the template. Note that there is a maximum limit to the number of variables you can select. This limit is set in the server, so for On-Premise users it can be adjusted by the server administrator.
You can select the columns that are displayed in the Available and Selected Variables lists; click the appropriate Columns button and select the columns you wish to see. The columns selected will be remembered by the system and will be presented in future sessions.
Figure 4 - Example of the Choose Questions page for a Delimited template
When generating a Survey Data Template for a project which contains loops, the loops will be represented as levels in the drop-down menu - . Each level can be selected individually for editing tasks.
Note: When the Template is flattened (go to Flattening a Template for more information), this drop-down menu will be grayed out.
Figure 5- Example of the loop level drop-down
The new template is added to the list, its location depending on how the list is currently sorted. Note that if you make changes in the editor and attempt to leave before you have saved, a confirmation message dialog will be presented.