Server User Guides > Survey Tabulation > Working with variables > Adding a category based on another variable
 
Adding a category based on another variable
Sometimes you might want to add a new category that is based on another variable. For example, in the Museum sample data set, you can add a category to the biology variable that selects respondents who entered a value greater than 4 when answering the question “How many times have you visited the museum before today?” (this the value in the visits variable). You can do this by adding a user-defined category to the variable.
These instructions describe how to create a category for a variable so that it applies to all tables. If you want to create the category in a specific table, use the Edit Axis dialog.
To adding a new category to a variable
1 Select the Define tab.
2 In the Variable List, select the variable you want to change, and then click Variables > Edit.
The Edit Variable dialog opens: see Edit Variable dialog.
3 Select the item in front of which you want the new category to appear. To add the category at the end, do not select anything.
4 From the menu at the top of the Edit tab, choose Insert.
The Insert Item dialog opens: see Insert Item dialog.
5 In the list of Available Items, select User-Defined Category.
6 Click Add, and then click OK.
This inserts the new category into the list of items on the Edit tab.
7 Enter a label for the new category, for example, More than Four Visits.
In the row that contains the new category, click Edit item. The Edit Category dialog opens: see Edit Category dialog.
8 In the Variable List, select the variable on which you want to base the new category, for example, visits.
9 Define the expression for the category. For example, select Greater than, and then enter 4. Then click OK.
10 Click OK again to close the Edit Variable dialog.
The changes are applied to any existing tables that include the variable next time you populate them, provided you have not used the Edit Axis dialog (see Edit Axis dialog to specify how the variable is to appear in any of those tables).
See also
Working with variables