The Select tab allows you to establish selection rules which will govern which items will be included or excluded from the report. The rules are input as selection criteria and, where more than one item of selection criteria is applied, they have to be linked together by use of the selection logic.
The tab is split into two areas.The top of the tab allows you to input up to 10 lines of selection Criteria. The bottom of the tab is used to input a selection Logic.
What do you want to do?
Field names are input in the same manner as derived fields, they must
adhere to the following format:
! to show a field name is being specified
x to show the table !id number
_ to separate the file !id from the field name
y a field name of up to eight characters
Double click in the column adjacent to the first available letter, or
alternatively click the Insert button.
The Insert Selection Criteria form is displayed.
You now need to type in the selection. This will normally consist of
a minimum of three elements:
Column name
Operator
Value
Tip: You can click the Insert Field button and use the
Select Item From List dialog box to help you type in your selection rule.
The selection rule would represent something like:
'include sales ledger accounts
greater then A00001'
The column would be the account number
The operator is 'greater than'
The value is 'A00001'
The column name can be taken from any of the tables named on the
Tables tab. You can also name any of the derived fields.
The operator can be one of the following:
Symbol Meaning
> Greater than
< Less than
>= Greater or equal
<= Less or equal
<> Not equal
= Equal
Field Names
!x_yyyyyyyy
Select tab Criteria
The value is input after the operator. If the field is alpha-numeric then the value must be surrounded by quote marks.
Thus the completed selection line would look like this:
!1_ACCOUNT > "A00001"
Further items may be put onto subsequent lines of the Select tab.
Once the selection criteria are input, you must complete the logic. Click into the logic field and type in the correct logic using:
Letters from A to J to represent the selection lines you have used.
A relational character of either '&' (to represent AND) or '/' (to represent OR).
If required you may also use brackets '( )' to isolate parts of the logic.
Finally, following input of the logic, you will select either 'I' or 'E' in order to include or exclude items according to your logic.
In order to illustrate the use of this tab several examples are laid out below.
To include all vehicles in stock at Location 'B' which have a Sales Status of 'A' as long as they have been in stock for less than 90 days.
|
A |
!1_LOCATION = "B" |
|
B |
!1_SALESTAT = "A" |
|
C |
!1_DATEIN >= !J(TODAY)-90 |
|
If |
A&B&C |
I |
To include any vehicle in Location 'B'. As well as this the report should also include any vehicle in Location 'A' as long as it has a Sales Status of either 'I' or 'X'.
|
A |
!1_LOCATION = "B" |
|
B |
!1_LOCATION = "A" |
|
C |
!1_SALESTAT = "I" |
|
D |
!1_SALESTAT = "X" |
|
If |
A/(B&(C/D)) |
I |
Note: Note the use of the brackets in the logic statement. These are used to split out the selection criteria and allow them to be formulated separately. Brackets may be nested as deeply as space allows.
To include a Prospect record if the date of the last contact falls between two dates which are being prompted for at the time the report is being run.
|
A |
!1_LCONTACT >= !0_LODAT OR !0_LODAT=0 |
|
B |
!1_LCONTACT <= !0_HIDAT OR !0_HIDAT=0 |
|
C |
|
|
D |
|
|
If |
A&B |
I |
Note: If you are prompting for values you should consider using the type of format shown in Example 3 above, in order to allow you to leave the prompt fields blank.
To include all Accounts which have an outstanding balance of more than £500 and a Category code of "I".
|
A |
!1_BASETOTL > 500 AND !1_CATEGORY="I" |
|
B |
|
|
C |
|
|
D |
|
|
If |
A |
I |
Note: You can see from Example 4 that two statements could be included on one line of selection. This can be very useful particularly where a lot of selection rules need to be applied.
Once again please note that in all of the examples above, any character values that are being used are surrounded by quote marks.
All of the examples shown in the previous section for selection criteria included examples of selection logic. The logic is vital because it tells the system how each element of the selection criteria relates to the others. The selection logic strictly controls the characters it can deal with. It will recognise the first character on each line, these range from A to J. It will recognise the & sign to signify AND, it also recognises the / sign to signify OR. Finally it will recognise the existence of brackets, (), to nest items of logic.
Thus if items A,B,C and D all had to be true to select an item then type in A&B&C&D.
If either item A or B had to be true type in A/B.
If items A or B have to be true in conjunction with items C and D then type in one of the following statements.
(A&C&D)/(B&C&D)
or
(A/B)&C&D
The second one is more efficient but both will work equally well.
The final part of the selection routine is to decide whether the criteria and logic which have just been input should be used to include the items in the report or exclude them.
Click the Include or Exclude radio button accordingly.