In this article
Variables within the templates have two kinds of properties:
- Common properties, which are displayed for all variables as a table in the upper right panel of the Template Editor page.
- Type-specific properties, which are displayed for the currently selected variable in the lower right panel of the Template Editor page.
All properties can be changed, either by typing a new value into the field or by choosing a value from the associated drop-down list. If a non-legal value is specified, then a message displaying a description of the error appears.
Note: The name of the variable cannot be changed.
The common properties displayed in the upper panel are as follows:
- Number - indicates the position of the variable within the template, and the order in which variables are displayed within the variable list. You cannot change the ID directly but you can do it by moving variables within the template.
- Name - the name of the variable representing the Question ID in Forsta Plus. This cannot be changed.
- Label - label of the variable (go to Mapping Variables for more information). The label of the variable represents the Question Title in Forsta Plus. You can change the label of a variable by double-clicking on the Label cell of the variable and typing the new label in the text field.
- Type - type of the variable. Available types are as follows: character, date, logical, multiple, quantity, single, time (go to Variable Types for more information). You can change the type by clicking on the Type cell of the variable and selecting the type from the drop-down list.
Important
When you change the type of a variable, any properties that are common for the old type and the new type remain, in addition to their values. Properties that are available for the old type only are deleted. New properties that become available for the new type are given default values.
When you click on the Type field and select a new type for a variable, a notification dialog displays prompting you to confirm the type changing operation. Click OK to confirm or Cancel to cancel execution of the operation.
In the examples shown below - , the type of the variable is changed from 'multiple' to 'single'. Properties such as Category Number, Code and Value, along with their values, remain unchanged. However the Use Spread property is deleted, and properties such as Format and Score are created.
Figure 1 - Example of the variable type being changed from Multiple to Single, before the change
Figure 2 - Example of the variable type being changed from Multiple to Single, after the change
The following properties are related to the range which a variable occupies within the template. The range determines the location and the size of a variable within the template. Note that these properties are only available in Fixed Width and Quantum templates.
- Start - specifies the start column of the variable. You can change the range start value by double-clicking on the Start cell of the variable and typing the new value in the input field.
- Finish - specifies the end column of the variable. You change the range start value of a variable by double-clicking on the Finish cell of the variable and typing the new value in the input field.
Note: Ranges of different variables must not overlap. When the start and/or finish values of one variable are changed in such a way that the range overlaps the range of another variable, a Range Overlap error is generated. In this case, the Errors fields of the variables with overlapping ranges display the error message and the variable rows are highlighted in red.
- Quantum templates have two additional columns: Start Card and Finish Card - these represent where the card containing the data is stored.
- Length - specifies the length of the variable, which is determined by the start and finish values. You can change the range length value of a variable by double-clicking on the Length cell of the variable and typing the new value in the input field.
Note: The minimal length requirement must be kept for every variable. When the length of a variable is less than the allowed minimal length, then the insufficient range length error occurs. In this case, the Errors field of the variable with insufficient length indicates the error message and the variable row is highlighted in red.
The minimum length requirements differ depending on the variable type:
- Character - the minimum length is the same as the numeric size value specified in the Size field of the lower right panel - .
Figure 3 - Properties of a Character variable
- Date - the minimum length is 8, which corresponds to the date format YYYYMMDD - .
Figure 4 - Properties of a Date variable
- Logical - the minimum length is 1, which corresponds to the size of the possible values TRUE/ FALSE.
- Multiple - the minimum length is the same as the numeric value specified in the To field of the lower right panel unless the Use Spread option is checked (go to Spread for more information). If the option is checked, then the minimum length equals the product of the numeric value specified in the Subfields number by the numeric value specified in the Subfields width (in the example below, 2 * 12 = 24 - ).
Figure 5 - Properties of a Multiple variable
- Quantity - the minimum length equals the number of digits of the numeric value specified in the To field of the lower-right panel - .
Figure 6 - Properties of a Quantity variable
- Single - the minimum length is 2 unless the Use Range option is checked. If the option is checked, then the minimum length equals the number of digits of the numeric value specified in the To field of the lower-right panel - .
Figure 7 - Properties of a Single variable
- Time - the minimum length is 6, which corresponds to the time format HHMMSS - .
Figure 8 - Properties of a Time variable
Note: Click Reallocate in the upper left corner on the toolbar to automatically allocate variables by their range values and IDs in ascending order. Note that the range values of the variables may be changed in accordance to the set Fix by rule (see below for detailed information). Reallocation may also change the ID of the variables. The Reallocate button is not available in Simple templates.
- Filter - indicates whether the variable has a filter assigned to it. A filter is a logical variable that filters the variables that you can see in the Template Editor (it does not affect the export or anything else). This can be achieved by generating a logical filter first, then this variable can be used to "flag" a particular variable or group of variables. Any variable except the logical one can be assigned a filter by clicking on its Filter cell and selecting a logical variable from the drop-down menu - .
Note: The ID value of the logical variable assigned as a filter must be lower than the ID value of the variable to which it is assigned, i.e. the filter variable must be placed before the variable to which it is being assigned. This can be done by moving the logical variable (go to Moving Variables for more information).
Figure 9 - Example of applying a Logical variable as a filter
- Errors - indicates whether the variable has errors related to range overlaps or insufficient length (see above for details). When a variable has an error, its row is highlighted in red, and the Errors cell contains a brief error description and recommended solution. When you point the cursor over an Error cell containing the error description, a floating text appears displaying the same error description so you do not have to resize the column to read it. When a variable that has no errors is selected, it is highlighted in blue.
- Fix by - specifies which range parameter of the variable remains unchanged when reallocation of variables is applied (go to Reallocating Variables for more information). or Update from Project is executed (go to Updating the Template from Project for more information). To change the Fix by parameter for a variable, click on the variable's Fix by cell and choose the desired value from the drop-down list.
Available values are:
- None - the start range value of the variable in question becomes higher than the range end value of the previous variable by 1, i.e. no gaps are left between the range start of the variable in question and the range end of the previous variable. The length is set to the minimal length value, which depends on the type of the variable (see above for details). Thus all range values of the variable (start, finish and length) are changed. In the example - , displaying the range values of a quantity variable 'resp' before reallocation, you can see that its range start value is 12 whereas the range end value of the previous variable 'responseid' is 10. This makes a gap of 2 units between the variables' ranges. The range length of variable 'resp' is 12, whereas the default minimal length for a quantity variable is 8.
Figure 10 - Example of Range values before reallocation, with None selected as the Fix By rule
When you apply Reallocate you will encounter the following changes: the range start value will be set to 11, and the range length value will be set to the default value for this type, in this case 8. The range end value will be changed to 18 - .
Figure 11 - Example of Range values after reallocation, with None selected as the Fix By rule
- Position - the range values of the variable are not changed so its position is not changed. In this example, the variable `resp` is Fix By position. When you apply Reallocate, the Start and Finish values will remain unchanged -
Figure 12 - Example of Range values after reallocation with Position selected as the Fix By rule
- Length - the range start value of the variable becomes greater than the range end value of the previous variable by 1. I.e. no gaps are left between the range start of the variable in question and the range end of the previous variable. However, the length of the reallocated variable remains unchanged so only the start and end values may change. In the example below, as a result of reallocation, the range start value is set to 11 and the range length value is left unchanged. The range end value is changed to 22 -
Figure 13 - Example of Range values after reallocation with Length selected as the Fix By rule
When you click the Fix by button in the Selected Variables page toolbar, the Fix by... overlay opens - .
Figure 14 - The Fix by... overlay
This overlay allows you to apply the selected parameter to all variables or just those you have already selected. The options are:
- Position - The column positions specified in the Start and Finish columns will be fixed. Use this function to maintain the column positions when updating the Template with the changes in the project running the “Update from project” process, and to maintain the column positions when exporting Survey data.
- Length - The variable length specified in the Length column will be fixed. Use this function to maintain the variable length when updating the Template with the changes in the project running the “Update from project” process, and to maintain the length when exporting Survey data.
- Not fixed - changes the selected variables or all variables to Fix by = None. This means the variables are not fixed by positions or length.
The type-specific properties (go to Variable Types for more information) displayed in the lower panel are as follows:
-
Use type - describes the role of this variable in the survey. This property is available for quantity variables. Available values are:
- None- means that the variable does not contain weight or serial number (default value).
- Serial - means that the variable contains the serial number (or other identification field) for the case.
- Weight - means that this variable contains a case weight.
- From - defines the minimal numeric limit of the variable's value. This property is available for date, time, quantity, single and multiple variables.
- To - defines the maximal numeric limit of the variable's value. This property is available for date, time, quantity, single and multiple variables.
- Serial - this check-box defines whether the variable contains the serial number (or other identification field) for the case. This property is available for character variables. For example, the responseid would have set use type=serial.
- Size - defines the maximal length of the value string. This property is available for character variables.
-
Format - is used to declare the format of the codes for the variable. This property is available only for single variables. Available values are:
- None - means that all the codes for the variable are to be treated as numbers (default value);
- Numeric - means that all the codes for the variable are to be treated as numbers;
- Character - means that all the codes for the variable are to be treated as characters rather than numbers. Character codes are case-sensitive (so “a” and “A” are different).
- Use range - this check-box defines if a limited range is used for the variable's value. If this option is checked, then the From/To fields appear (see above for more information).
-
Use spread - indicates that the data
values are coded as a series of category values in consecutive subfields rather than the default
multiple format of a series of 0/1 characters (go to Spread for more information). This property is available for multiple variables.
If this option is checked, then two additional fields for two corresponding properties appear:
- Subfield number - defines the number of subfields within the overall field. The value must be a positive integer.
- Subfield width - defines the width of each subfield. The value must be a positive integer.
Note: There can be at most one serial variable, which may be a character variable or a positive integer quantity variable, and one weight variable, which must be a positive integer quantity variable. The data values must be unique and should not be missing. When you duplicate the serial or the weight variable, the duplicated variable will not be serial or weight, respectively. If you assign the weight or serial property to a variable when the weight or the serial variable already exists, then the dialog window appears prompting you to disable the serial or weight property for the current serial or weight variable, respectively, and to assign the property to the variable being edited.
Single (go to Spread for more information) and multiple variables also have several additional properties, which are related to categories within these variable types. These properties are as follows:
-
Code - denotes the code of the variable's category. This property is available for multiple and single variables.
For single variables, if this attribute is not present or the Format property (see above for detailed information) is set to "numeric" then the code values must all be positive integers or the value zero. However when the Format property is set to "character" then all code values (even those that look like numbers) are treated as case-sensitive characters.
For multiple variables, the code values must be positive integers.
- Score - allows score values to be assigned to the individual code values to be used for computing statistics such as Mean, Standard Deviation etc. This property is available only for single variables. The value must be a number, with or without a decimal point and decimal places. The omission of a score implies that records having that value code should be omitted from the base for any statistical computation for that variable.
- Value - defines the set of legal values and optional text labels for values (e.g. categorical codes).
You can manage categories of single and multiple variables by means of the buttons of the toolbar in the lower panel, which are as follows:
- Add - click this button to add a new category to the variable.
- Delete - click this button to delete the variable's categories selected in the category list.
- Move Up - moves the variable's categories selected in the category list one position up.
- Move Down - moves the variable's categories selected in the category list one position down.
Note: Ensure you have checked the validation settings (go to Validation Rules for more information) before manipulating the template by managing the variable categories (go to Survey Database for more information).