You are here: Commands > Set with No Preference Equivalents > Set Filter

Set Filter

Limits the records to be processed in the active primary table. Also eliminates the need to include an If test on each subsequent command.

Using the Set Filter command with the TABLE n parameter will cause a switch to the primary table with specified ID followed by the application of the specified filter, exactly as if the two commands had been executed consecutively.

All commands after a Set Filter apply only to the filtered records of the active primary table until you turn the filter off by issuing a simple “Set Filter” or issue another Set Filter command with a condition. Additionally, by closing the active primary table, or opening a new primary table, any active SET FILTER command will be turned off.

Command Mode Syntax

SET FILTER <TABLE n> <TO> <test>

Examples

SET FILTER Amount > 1000

TOTAL Amount

STATISTICS Amount

COUNT IF Dept = “13”

is equivalent to:

TOTAL Amount IF Amount > 1000

STATISTICS Amount IF Amount > 1000

COUNT IF Amount>1000 and Dept=“13”

Counts for records meeting the filter and any command If tests are reported separately. In the Count example above, the result could be:

• 90 of 500 matched the filter: Amount > 1000
• 4 of 90 met the test: Dept = “13”

To turn off the SET FILTER above, simply enter:

SET FILTER