About data filters

When defining data sources that contain more than one record type, such as Print Image (Report) files and Multiple Record Type files, you need to be able to identify which type of record you are using at any time. In Analytics you use data filters to identify the distinct record types in a file and, when necessary, to exclude unwanted records.

Data filters are used to identify portions of a data file that can be defined as records and fields for an Analytics table. Data filters are defined using conditions that indicate which parts of a data file should be included in a record or excluded from the record.

When you start to create a new data filter in the Add a New Data Filter tab, an Exclude All condition is created by default which excludes all character data in the source data file and highlights all characters in black.

To define your record, you must specify at least one filter condition by selecting a character or set of characters that can be used to uniquely identify each instance of the record you want to include. When you click a data element to select it, Analytics identifies it as a filter condition and adds its description to the filter conditions text box. When you create a filter condition to include a record, the black highlighting is removed from all of the lines that match the filter criteria. If there are portions of the selected record that you do not want to include in the record, you can specify another filter condition to exclude a portion of the record.

You can define more than one data filter in the same data file. A common style of report lists a header record, which could include information about a product class, followed by a number of detail records that are associated with that product class.

In this example, the header record contains additional information associated with the detail records, such as the product class number, and the product class name. To combine this information with the detail records, you need to define the fields in the header record as static fields by selecting the Static checkbox for each field in the Edit Fields/Expressions tab. When you create a new data filter, you are prompted to indicate whether the information in the record type relates to subsequent records. If you answer Yes, the fields you define in the record will have the Static checkbox selected by default. You can also select the Static checkbox for each field manually.

Create a data filter

Data filters are used to identify the record, or records, in a data file. Creating a data filter involves identifying rules that define the area of the data file that should be included in your Analytics table, and exclude any data that should not be included. Data highlighted in black in the preview table is excluded, and data highlighted in white is included.

If there is an active data filter it is deactivated automatically when you create a new filter.

If you want to edit an existing data filter, you can edit it as a computed field in the Table Layout dialog box. To display data filters in the Table Layout dialog box, you must select the Include Filters in Field Lists option in the Interface tab in the Options dialog box (Tools > Options).

Steps

  1. Select Edit > Table Layout.
  2. Click the Add a New Data Filter tab.

    The contents of the data file are displayed in the data preview area in the bottom half of the screen. By default all data displayed is initially excluded. This is indicated by the “Exclude All” condition listed in the data filter list, which cannot be modified or deleted.

  3. Select a unique character or sequence of characters in the record to define the filter condition. Click an individual character to highlight it, or click and drag to select more than one character, and click Include to select all of the records that match the specified condition.

    For example, a data file might have the decimal point in byte position 71 of each row that should be included in your Analytics table. You need to include this decimal point in your filter. If the decimal point is in the same position in any rows you do not want to include, you will need to create a rule to omit the incorrectly selected rows.

  4. If you want to exclude part of a selected record, select a unique character or sequence of characters in the record to define the filter condition and click Exclude.
  5. Click Accept Entry to create the data filter with the specified conditions.
  6. In the Save Filter As dialog box, enter a name for the filter and click OK.
  7. Click Yes in the Keep this filter active? dialog box to start defining the fields in the record. If you want to define the fields later click No, and select the filter from the drop-down list in the Edit Fields/Expressions tab when you want to define the fields.

    When the filter is active the areas of the data file that are excluded from the record are highlighted in black in the Edit Fields/Expressions preview table. Select the individual fields from the white areas of the preview table to add them to the record.

Activate a data filter

When you create a data filter in the Add New Data Filter tab in the Table Layout dialog box, you are prompted to activate the data filter. You can also activate an existing filter, change the active filter, or deactivate a selected filter, by selecting the appropriate option from the drop-down list in the Edit Fields/Expressions tab in the Table Layout dialog box.

When a data filter is activated, only records and fields that meet the data filter criteria can be viewed and processed.

When a data filter is active the following behaviors apply in the Edit Fields/Expressions tab:

  • Any fields you define are associated with the active data filter.
  • The fields in the table are evaluated against the criteria for the data filter. Fields that do not meet the criteria are not displayed in the fields list.
  • Rows that do not meet the filter criteria are highlighted in black in the data preview table.
  • Select the “All fields” option from the drop-down list to deactivate the active filter and display all fields defined for the table.

Steps

  1. Select Edit > Table Layout.
  2. In the Edit Fields/Expressions tab, select the data filter to activate from the drop-down list above the fields list.

    The fields list is updated to only show the fields that belong to the selected data filter. To deactivate the data filter select “All fields” from the drop-down list.