Tables and axes > More about axes > Filtering within an axis
 
Filtering within an axis
Quick reference
To define a condition that applies to a group of consecutive elements, type:
n00;c=logical_expression
logical_expression is any valid logical expression.
More information
If you have a condition that applies to a group of rows in a table, in addition to the individual row condition, there are two ways of dealing with this. One way is to make each row condition an ‘and’ condition by combining the global condition with the row condition, for example:
n01First Row;c=c136'1'.and.c140'1'
n01Second Row;c=c136'1'.and.c140'235'
The other is to enter the global condition separately using an n00 (N-zero-zero) statement.
An n00 defines a condition applicable to all subsequent rows until another n00 is read or until the end of the axis, whichever is the sooner.
One of the most frequent uses of this statement is in tables which show whether or not a respondent liked a particular product, and then lists reasons why they did or did not like it. For example, the axis:
l pref1
col 321;Base;Liked Product;Disliked Product;DK/NA=rej
n03
n00;c=c321'1'
col 322;hd=Reasons for Liking Product;Cleans Well;
+Lasts a Long Time;Smells Nice; ....
n03
n00;c=c321'2'
col 325;hd=Reasons for Disliking Product;Inconvenient to Use;
+Too Expensive; ....
has three sections, each one separated by a blank line (n03).
The first section shows how many respondents liked the product (c321’1’) and how many disliked it (c321’2’). To include all eligible respondents in this section, the third row includes anyone who does not have a 1 or a 2 in that column. These would be people who did not have a preference or who refused to answer the question.
The second section deals only with those who said they liked the product, so it uses the n00 to exclude everyone else. Using n00 here is efficient; without it, you would have had to write one statement for each reason, with each reason having a complex condition, as shown previously.
The third section is the same as the second, except that it includes respondents who did not like the product.
In this example, the first filter was turned off by another n00 defining a new filter, and the second was terminated by the end of the axis. To turn off a filter before the end of the axis without defining a new filter, enter an n00 without a condition. This causes all respondents to be eligible for inclusion in the following elements.
See also
More about axes