Server User Guides > Survey Tabulation > Working with variables > Creating variables
 
Creating variables
You can create variables using the following options on the Variables menu:
Copy
To creates a new variable based on an existing variable, click a variable, and then click Variables > Copy. The New Variable dialog opens: see New Variable dialog.
This is useful when you want to define alternative ways of tabulating a variable. You can copy any numeric, categorical, text, date, or Boolean variable, provided it is not a derived variable.
Merge
Combines two or more variables to form a new variable. This is useful when you want to create a total awareness variable or when you want two or more categorical variables to be treated as one variable in your tables.
When merging categorical variables, the new variable will automatically have the same categories as the categorical variables you are merging. If the same category appears in more than one of the variables, it will appear only once in the new variable.
When merging text variables, the new variable will contain the texts from the text variables you are merging, concatenated together.
When merging numeric or date variables, the new variable will contain the sum of the values stored in the variables you are merging.
Select the variables you want to merge, and then click Variables > Merge. The New Variable dialog opens: see New Variable dialog.
The variables must have the same data type, must not be derived, and if you are using the hierarchical view, they must be at the same level. For example, provided they are at the same level, the variables could all be categorical (although they can be a mixture of single response and multiple response), or they could all be text, or all numeric.
New Advanced
Creates a new variable based on other variables using your own formula. Before you select this option, select the variable in front of which you want the new variable to appear. If this is a hierarchical project and you want the new variable to be inside a loop, expand the loop and select a variable inside the loop. This option opens the New Variable dialog: see New Variable dialog.
New from Side/Top
Creates a new variable based on the current definition of the side or top of a table. Click in the Side or Top area of the Table Structure section of the Define tab to select the side or top definition:
Then, choose New Variable from Side/Top from the Variables menu, or click the New Variable from Side/Top icon in the Table Definition toolbar This graphic is described in the surrounding text..
In the Table Variable dialog, enter a name and description for the variable, and click OK.
Notes
You cannot base a new variable on a derived variable.
Copying a variable does not copy any changes you made to the original variable. For example, suppose you band a numeric variable and then use the Copy option to copy it. You will need to band or summarize the new variable before you can include it in a table, because it will not contain the banding you set up in the original variable. Similarly, suppose you insert some nets in a multiple response variable and delete some of the original categories. If you then copy the variable, the new variable will contain the original categories (including the deleted categories) but not the nets. The same thing applies when you create new variables using the Merge and New Advanced commands.
Copying or merging categorical variables that contain built-in special elements does not copy the built-in special elements. You are most likely to see this when you are working with Quanvert data, which typically contains built-in special elements. For example, if you copy a Quanvert variable that contains a built-in mean, the new variable will not contain the mean. Similarly, built-in bases are not copied and UNICOM Intelligence Reporter - Survey Tabulation will therefore insert an autobase into the new variable. This might mean that the base is different in tables created using the new variable compared to the original variable.
Sometimes you might want to merge variables of different data types. For example, suppose you want to create a categorical variable for use as a banner or breakdown in your tables and you want this new categorical variable to combine a categorical gender variable and a numeric age variable. This is possible in UNICOM Intelligence Reporter - Survey Tabulation, but not using the Merge option. For more information, see Merging a categorical and a numeric variable.
If you are using the hierarchical view of the data, the position of the variable(s) that you select before choosing these commands will define the level of the new variable. For example, if you select a top-level variable, the new variable will be at the top level. Whereas, if you select a variable in the Person loop, the new variable will be at the Person level.
New variables and changes you make to existing variables are saved in the Table Document (.mtd) file and apply to the current table document only, not to the whole project. When you share a table document with colleagues, they can see the variable edits you have made. When you create a new table document, the variables revert to their original form. If you want variable edits to apply to all your table documents, you can create a template document that includes the variable edits. Any new table documents created using the template include the variable edits. For more information, see Managing template table documents.
See
Copying a variable
Merging categorical variables
Creating a summary statistic table
Clearing a variable’s axis expression
Deleting a variable
Restoring the project variables
See also
Working with variables