Tables and axes > Filtering groups of tables > Named filters
 
Named filters
Quick reference
To define a set of filter conditions and options that you can refer to by name, type:
flt=name[;c=logical_expression][;options]
More information
Named filters increase the efficiency of, and reduce work in, a program where sets of tables, each with its own flt statement and text, are interspersed.
Conditions, options and text are defined using filter statements, but this time you give the filter a name. The syntax is:
flt=name;filters and options
where name is a name of up to 15 characters, and filters and options are as described for general filters above.
This can then be followed by tt statements describing the filter. For example:
flt=male;c=c106'1';op=120
ttlMales
defines a filter to include men only.
To use a named filter, add flt=name to each tab statement requiring the filter. The statement:
tab ax01 demo;flt=male
produces a table of ax01 by demo filtered by C106’1’, using the heading males.
When filters are applied in this way, they refer only to the table on which they are named. A named filter on a tab does not override any previous general flts whose conditions apply to that table. The conditions are additive in this case.
For example, if you have a series of tables consisting of one table each for men, women and all respondents, followed by another set for the same three groups, and for one reason or another you cannot rearrange them and use general filters or use 3-dimensional tables, you can create three named filters and applying each one in turn to the tab statements which create the sets of tables for men, women and all respondents. You might write:
flt=male;c=c106'1';op=012
flt=fem;c=c106'2';op=012
flt=all;c=c106'12';op=012
tab ax01 demo;flt=male
tab ax01 demo;flt=fem
tab ax01 demo;flt=all
See also
Filtering groups of tables