• Keine Ergebnisse gefunden

Relational Operators

Im Dokument Perfect Filer (Seite 133-140)

It is often necessary to select members of a subset according to some relationship which the member possesses to the subset selection criteria. This is often expressed as a range of numeric values. For example, all senators over age 50, or all congress-persons up for reelection between 1984 and 1986. The ability to define such a subset is provided in Perfect Filer by the RELATIONAL OPERATOR Command:

The RELATIONAL OPERATOR command allows you to specify any of the fol-lowing relationships:

Defining Subsets 129

Date and Time Templates

It is possible to specify relational operators for the 'Date' and 'Time' templates.

For a date or time to be less than another means that it is earlier, while greater than means later.

Note: When specifying a relational operator for a template, be sure to position the cursor in the first data field of the template before giving the RELATIONAL OPERATOR command. Otherwise the relational operator will apply only to a sin-gle field within the template.

Numeric Limits

Upper and lower limits for a numeric field can be specified but you must com-plete two data records, 'Primary Selection Criteria' and 'Limit Selection Criteria'.

For example, to specify all senators over age 50 and under age 90, enter "50" in the Primary Selection Criteria data record, with a relational operator of greater than or equal, and "90" in the Limit Selection Criteria, with a relational operator of less than or equal.

Selecting a Subset by Relative Date

It is possible to select a subset of members which have been entered or revised within the past day, week, or month. For example, you may wish to generate mail for all customers that have made phone requests during the past week, or you may want to make a list at the end of the month of all orders received during that month. The TIME OFFSET command (Control-T) allows you to define such subsets.

When using the TIME OFFSET command, you will be asked to provide an "off-set" date from the current date. Each time the subset is extracted, the current date plus update days will be inserted into the 'date entered' template of the selection criteria subset, thereby changing the subset definition relative to the date of ex-traction.

SPECIAL SUBSET DEFINITIONS

TUTORIAL

Suppose you want to revise the previous subset selection criteria, all Senators up for reelection between 1984 and 1986. Of these you want only those whose last names begin with "W", and who have been added to the data base in the last 30 days.

STEPS:

1. With the Perfect Filer diskette on drive A of the computer and the data base diskette on drive B, call up the FILER program:

r ~---~::::

II A>

flier

<CR>

2. After verifying the date, select the Define Subset option of the FILER main menu, followed by the option 'Review/Revise Subset' of the second level menu.

Perfect Filer will present a list of all currently defined subsets. Select Senators for reelection in 1984.

3. Perfect Filer asks if you want to change the description (name) of the subset. A description up to 57 characters long can be entered:

Se?ators/Reelect 1984-86/I W" /New within 30 days Perfect Filer responds with the display:

Tutorial

Senators/Reelect 1984-86/"W"/New within 30 days [X] Display Subset Definition

[ ] Define Primary Selection Criteria [ ] Define Limit Selection Criteria [ ] Save Subset

Defining Subsets 131

4. Select the second option 'Define Primary Selection Criteria'.

Perfect Filer presents the data record holding the original subset selection criteria.

5. Move the cursor to the , lastname , field and enter "W*". This will cause Per-fect Filer to select every data record whose last name begins with "W".

6. Move the cursor to the field Up for reelection: 1984. Position the cursor on the

"8", and give the RELATIONAL OPERATOR command,

Perfect Filer responds with the display:

Select the relationship of the subset to the data being entered:

[ ] Equal [ ] Greater [ ] Less

[X] Greater or Equal [ ] Less or Equal [ ] Not Equal

Tutorial

7. Select the fourth option 'Greater or Equal'. This will cause Perfect Filer to select every member record showing a reelection date of 1984 or later.

8. Now escape to the previous menu and select the third option, 'Define Limit Selection Criteria'.

Perfect Filer responds with a blank data record.

9. Move the cursor down to the Up for reelection: 19 _ _ field and enter "86", afterwards giving the RELATIONAL OPERATOR command:

Perfect Filer again presents the list of relational operators (see Step 6).

10. Select Less or Equal to indicate all records holding a date less than or equal to 1986, and then escape to the previous menu.

You have just used two separate data records to define upper and lower numeric limits for the Up for reelection field. Perfect Filer will now extract all members who are up for reelection between 1984 and 1986.

11. Since you have one more modification to make to the primary selection cri-teria, select the second option again, Define Primary Selection Criteria.

Perfect Filer redisplays the first data record.

Tutorial

Defining Subsets 133

12. Move the cursor to the last field on the screen, the 'Date Entered' template.

You wish to specify every member who has been entered into the data base within the last 30 days from today ("today" meaning whatever day you hap-pen to extract the subset from the data base).

Making sure the cursor is positioned on the first field in the data entered tem-plate, hit the TIME OFFSET command, Control-T:

Perfect Filer responds with the message:

Enter TIME OFFSET from current date: _ _ _

13. The time offset in this case will be "- 30" (minus thirty).

Perfect Filer immediately returns you to the data record holding the primary selection criteria. Notice that the code "To-da-y" has been entered into the 'date entered' template, signaling that the TIME OFFSET command has been invoked for this template.

Tutorial

14. Now give the RELATIONAL OPERATOR command, Control-R, selecting afterwards the option Greater or Equal.

Perfect Filer again returns you to the data record. According to this definition, Perfect Filer will now select all members who have been entered into the data base within the last 30 days.

Your revision of the subset selection criteria is now complete. Check the sub-set definition display. Enter Escape and select Display Subsub-set Definition, printing to screen only.

The display should look like this:

Subset of Senators/Reelect 1984-86/"W"/New within 30 name.lastname <Equal> W*

houserep <Equal> true

reelect <Greater or Equal> 86 reelect <Less or Equal> 90

dtenter <Greater or Equal> <Current date>

update + - 30 days

15. The final step is to save the changes you have made. Select the last option, Save Subset.

END OF TUTORIAL

Tutorial

Im Dokument Perfect Filer (Seite 133-140)