Selection Criteria Concepts for Purging Rules

Once you have defined the general characteristics of a purging rule, you can set up the criteria for filtering the objects to be purged. A filter criterion allows you to select a subset of objects from a particular class. For example, you might want to select a specific group of work requests based on the request status.
For each filtering criterion, consider the following:
This topic explains these concepts in more detail.
Note: Before you begin creating filter criteria, you should have a good understanding of APM object modelling. For more information, see Object Model Overview.

Criteria Are Based on Class Attributes or Relationships

Every filter criterion starts from the class of objects that you want to select (for example, the Work Request class). You must then select either an attribute or a relationship to use to filter the objects.
In most cases, you will base the filter on an attribute (property) of the base class. For example, you might filter a group of work requests based on the WorkRequestStatus attribute. However, you can also use an attribute owned by a related class.
You can also filter a group of objects based on its relationship to anouther set of objects. For example, you might use the Work Request class’ Asset to work on relationship to select only requests for a specific asset or for a specific asset and its children.

Boolean Logic for Filter Criteria

When creating selection criteria, you can use the following components:
Sequence numbers are not available on these filter criteria.

Filter Groups

You can create filter groups to specify which criteria are evaluated together. This grouping, when combined with logical operators, determines how criteria are evaluated. Changing the group to which a criterion belongs often yields very different results.
Each filter group is identified by a number. The first criterion that you create is assigned to filter group “0”. By default, each new criterion is added to the same filter group. You can change the group to which a criterion is assigned by entering another group number in the Logical group box on the Filter Criterion dialog. You can add any criterion to any filter group. For example, you might want to evaluate all criteria based on the same attribute within the same group.

Logical Operators

Boolean logic allows you to define the relationship between filter criteria and filter groups. In Boolean searching, an AND operator between two criteria (for example, Title contains “pear” AND “apple”) returns records where the Title contains both values, not just one of them. An OR operator between two criteria (for example, Title contains “pear” OR “apple”) returns records that contain either of the words.
In some cases, two operators allow you to define the relationship between groups and between the criteria within a group. These are:
The default choice is AND within a group, OR between groups. Because each group typically contains only criteria for the same attribute, in most situations it is not necessary to change the default operator.
For example, the following criteria and the AND within a group, OR between groups setting:
are evaluated as: A=3 OR A=7 OR (B>11 AND B<21).
If the logical operator setting is changed to OR within a group, AND between groups and the groups the criteria belong to:
the set is now evaluated as: A=3 OR A=7 AND (B>11 OR B<21).

Data Types

Five sets of data-type-specific operators are available to handle each of the 27 different data types that APM supports. The five types of operators are:
The following types of attributes do not support filtering:

Filtering On Compound Data Types

Multi-part data types are problematic for filtering because they are more complex than simple data types like floats, strings, or integers. For example, the Duration data type is composed of a float and a unit of time. Because the unit of time is not necessarily the same for each item, they must be converted into a common unit of time before the comparisons required for filtering can occur. For example, if you want to see all of the work orders with a duration of less than two days, you should be able to get that result regardless of whether their duration is expressed in days, hours, or weeks.
The following sections explain the filtering behavior for each of the compound data types.

Quantities

A Quantity is a two-part data type comprised of a float and a unit of measure. To filter correctly on this type of attribute, you must take into account the unit of measure. For example, if you ask to see lengths of pipe that are less than four feet long, you expect to see those that are shorter than four feet whether the unit of measure is in feet or in meters.
Filtering based on quantities takes into account the conversion factor between different units of measure, provided that they are within the same category. Any records that have units of measure in different categories are excluded from the filtered list. For example, if the unit of measure used in the filtering criterion is feet (which is in the length category), any record that is not measured in length (for example, liters or pounds) is excluded.

Durations

The Duration data type is also made up of a float and a unit of measure, but the unit of measure is always from the Time category. Examples of durations are: one day, 24 hours, 1440 minutes.
The problem of different units of time is addressed in the same manner as for quantities.

Currency Amounts

The Currency Amount data type is a two-part data type consisting of a currency type and a float. Some examples of currency amounts are $10.00, DEM 7.00, or US$6.00. To correctly filter on this type of column, you must take into account the current exchange rate for the currencies.
Because the use of this data type is very rare in APM, and in cases where it is used the currency is always the same, filtering on this data type works in the same way as filtering on a Float-type attribute. That is, the system ignores the currency part of the attribute.

Prices

The Price data type is a three-part compound data type consisting of a float, a unit of measure, and a currency type. For example, $10.00 each, 400 Euros per meter, and US$6.00 per gallon are all prices.
The filtering behavior for these types of attributes is the same as that for Quantities: prices with units of measure within the same category are compared based on their conversion factor. The system ignores the currency part of the attribute.

Date and Time

The Date and Time data type consists of a date combined with a time. When filtering on this type of attribute, APM ignores the time segment if it is left blank in the filter criterion. In other words, if the time portion is not specified as part of the filter, the column is filtered as if it were a simple date.
When you filter on a date and time attribute, you can filter using conditions such as “Last week”, or “In the last 7 days”. If you select “In the last ...” or “In the next ...” conditions, you can filter on any amount of time.