Removing categories from a variable

You may not want to include all of the categories in a variable when you create a table. For example, you may want to exclude a category that does not contain any responses, or you may want to exclude the data for a particular category from your analysis.

You can use various methods to prevent categories from appearing in tables. The method you use will depend on your exact requirements. The examples below show the results of using different methods to remove the 65+ years category from a table of age by gender:

Note: These examples are intended to show the results of applying different methods to the same table, rather than to give examples of real world tables.

Deleting a category from a variable

This method removes the category from the table, so that it is not displayed in the table row or column. The case data is not removed from the base. However, as the category no longer forms part of the table specification, values for deleted categories are not included in any totals or subtotals that you add to the table. You can delete a category either for all tables that use the variable, or for the currently selected table.

In this example, the 65+ years category has been deleted from the variable. See the topic Deleting a category for more information.

Filtering out a category

This method restricts the cases that are included in a table. The values for the filtered-out category do not appear in the row or column for the category. They are also excluded from the base and from any calculations that use the base. If you have added totals or subtotals to the table, the category values are also excluded from these items. The category row or column is still displayed in the table, but the cells do not contain any data. See the topic Filtering Your Results for more information.

In this example, a filter has been added to the basic table to filter out the 65+ years category. See the topic Creating a Filter for more information.

You can combine filtering and deleting to remove a category both from the case data (so that it does not appear in the base) and from appearing in the table.

In this example, a filter has been added to the basic table to filter out the 65+ years category, and the category has also been deleted from the variable.

Hiding a category

This method prevents a category from being displayed in the table, without removing it from the variable or from the base. As the hidden category still exists in the table specification, values for the category are included in any totals and subtotals that you add to the table.

In this example, the 65+ years category has been hidden from the table.

See the topic Hiding a category for more information.

Excluding a category from the base

This method removes the values for the category from the base and from any calculations that use the base, while still displaying the category values in the table. As the category still exists in the table specification, the values for excluded categories are included in any totals and subtotals that you add to the table.

In this example, the 65+ years category has been excluded from the base.

You can use a combination of the Hide and Include In Base properties to remove a category both from the base and from the table display. However, as it is still part of the table specification it still appears in any totals and subtotals that you add to the table.

In this example, the 65+ years category has been hidden from the table and excluded from the base, by using the Hide and Include In Base properties.

Hiding rows or columns

You can also prevent rows or columns from being displayed in a table if the base counts are below a value that you specify. This does not remove the values contained in the hidden rows or columns from the base, or from any total or subtotals that you add to the table.

In this example, rows with base counts below 20 have been hidden (which has the effect of suppressing the 65+ years row). Although in this example the result is to hide a single category, this method applies to the whole table, not to individual categories. See the topic Hiding a Row or Column for more information.