How do I use the selection criteria in Datafile?

When running reports in Datafile you often have the option to use selection criteria to exclude data you don't want to see, and to include data that you do want to see.

Record Numbers

When you click on the selection criteria button a pop-up screen appears where you may enter up to 6 different criteria. In some reports (eg sales transactions reports) you also have the option to report on a particular range of database records. Regardless of the database being reported on and the information contained in it, each set of information that you put in (eg an account code with its address, balance etc or a transaction with amount, total, tax etc) is assigned a record number. This is done by the program itself, without user input, on a numerical basis starting at 1 and ending at 99,999 or 999,999 or 99,999,999 depending on which version of Datafile you have.

In the Sales and Purchase Ledgers, the starting record number defaults to the first transaction of the current period, as these are normally the transactions you would want to see. However, you can get the transaction reports to include records from a previous period by setting the starting record number back to 1.

Data Items

 

Underneath the record number range is a grid with 4 columns. The first column asks for the "data-item" to be tested and what you enter here depends on your knowledge of the data item names in the database and the information you actually want to see. You can type directly into the box if you know the item name you want, just type the corresponding data-item number (eg 3 usually corresponds to account on the Sales Ledger Transactions database) if you know it, use the F4 key to bring up a list of all the items in the database in number order from which to select, or click on the arrow to bring up an alphabetical list of data item names.

Selection Type

The second column shows selection type which should be fairly self-explanatory. What you put in here determines what kind of test is to be applied to the data. 'E' is 'Equal to', 'C' is 'Contains', 'G' is 'Greater Than' and 'L' is 'Less Than'. You can use a part of the data in the value column, so for example "ACCOUNT   E   BAL" will give you BAL001, BAL002...BAL0049 and so on, whereas "ACCOUNT   C   BAL" will give you BAL001, ABAL001, 001BAL and so on.

Value

This is the column for the data itself and determines what value the data-item is to be tested against.

Compulsory

This column acts as a "boolean" value - an and/or value. If you put a Y against one of your criteria you are saying that the test you are applying MUST be true. If you put an N here, your test MAY be true. Some simple rules can be applied here to get sensible information.
If you are only using one test then it does not matter if 'Compulsory' is set to Y or N because there is no further condition to test. On the other hand, if you are applying two tests to the same data item then you need to be careful whether they are compulsory or not. If you wanted to search for a transaction but weren't quite sure which of 2 accounts it was on, you could use the criteria:

data item sel-type value comp
ACCOUNT E BAL001 N
ACCOUNT E CCR001 N

which would give you all the transactions where the account was BAL001 OR CCR001. If you were to make both the criteria compulsory, the report would be looking for transactions where the account is BAL001 AND CCR001 - which is impossible and would therefore not return any records at all.

In the screen shot above the use of Y and N in the compulsory field is combined. A report using these criteria would return all the records dated in June 2003 AND on account BAL001 but where the type is EITHER 1 OR 3.

Saving Selection Criteria

If you find yourself needing to enter virtually the same criteria each time you run a report you can save the criteria so you don't have to enter them all again the next time. Instead of clicking/ticking the box for selection criteria, you can click to the right where it says 'previous criteria'. This launches another pop-up screen entitled 'selections' and containing a list of all previously saved criteria. If none have yet been saved on that report, the only option will be 'new selection'.

Double-click on 'new selection' to bring up the usual selection criteria screen, and enter the criteria as usual. When you have finished, click 'OK' and you will be prompted: 'save this selection criteria for future recall?'. If you respond Yes to this you will be presented with the 'selections' list again, but double-clicking 'new selection' now will enable you to give your criteria a name under which they are saved. You can then run the report, and when you next click on 'previous criteria' you will see your saved name in the list along with 'new selection'.

Software Connection, Unit 6, 1st Floor, Durable House, 8 Greenock Road, Acton, London W3 8DU
Tel: +44 (0)20 8896 3838  Fax: +44 (0)20 8896 3341
E-mail: enquiries@softwareconnection.co.uk