Local filters (command filters)

Local filters can be applied as part of an Analytics operation to restrict which records are processed by the operation. For example, you could include a local filter in a totaling operation on an Accounts Payable table to total only the invoices submitted by a particular vendor.

The expressions you use to create local filters work the same way as the expressions for global filters. For more information and specific examples, see Global filters (view filters).

Duration of local filters

A local filter applies to a single execution of a single Analytics operation only, and does not alter the display of records in a view. When the operation is complete, the local filter is no longer active.

Local filters differ from global filters, which remain active until you remove them, replace them with another global filter, or close the table.

Applying a local filter and a global filter at the same time

You can apply a local filter and a global filter at the same time. In this situation, an Analytics operation processes only those records that meet the criteria of both filters.

The two filters should be logically consistent. Records excluded by one filter cannot be included by the other filter. For example, if a global filter contains the criteria (Invoice_Amount >= 1000.00), and a local filter contains the criteria (Invoice_Amount >= 500.00), invoice amounts less than $1000.00 are excluded from processing, despite what the local filter specifies.

Create a local filter

As part of an Analytics operation, you can create a local filter, or select an existing named filter, to restrict which records are processed.

Simple filters can be manually entered in the If text box in Analytics command dialog boxes.

More complex filters, using multiple criteria, are easier to create in the Expression Builder. If you want to name and save a local filter, you must create it in the Expression Builder.

  1. In an Analytics command dialog box, do one of the following:
    • Enter the filter expression in the If text box.

      For example, Invoice_Amount > 1000.00. The filter is ad hoc and retained only during processing of the Analytics operation.

    • Click If to create a filter, or select an existing filter, using the Expression Builder.
  2. If you are using the Expression Builder, do one of the following:
    • Create the filter expression, optionally enter a name for the filter in the Save As text box, and click OK.

      If you enter a name for the filter, it is permanently saved with the table. If you do not enter a name, the filter is ad hoc and retained only during processing of the Analytics operation.

      Filter names are limited to 256 alphanumeric characters and cannot begin with a number.

      For information about using the Expression Builder, see Creating expressions using the Expression Builder.

    • Double-click a named filter in the Filters list, and click OK.

      Only named filters permanently saved with the table appear in the Filters list. Ad hoc filters do not appear in the Filters list.