‘Statistics View’ can be switched on using a function on the File menu. When it is turned on, the result of any ‘View…’ menu option will change significantly, assuming that more than one record is found. After going through the Quicksearch/More Choices Find windows in the usual manner, a grey window designed for quick statistical analysis, reporting and graphing appears.
Initially the window is essentially blank, showing in the title bar which function has been chosen (for example, ‘View Companies’), how many records have been found by the search and that ‘All selected records’ are being viewed.
The Analysis pop-up menu provides options by which the data can be broken down. The options available depend on which file is being viewed. For example, selecting ‘Type’ in the example shown will cause Enterprise 6 to count how many Companies in the selection there are of each Type. The first column will show the Type Codes and the Count column will contain the number of Companies found of each Type. To put it another way, the Companies are analysed by Type.
Note that in the above example, the first item listed is blank, representing all Companies with no Type. Therefore, one of the many uses of the ‘Statistics View’ window will be to weed out and update unclassified data.
The Analysis pop-up menu initially offers only those options which are the most logical and reasonably swift to use. This is to improve the initial speed of display. For example, the option of Company Code is not offered because, as all Company Codes are unique, a long list of Company Codes will be produced, each with a Count of 1. All non-indexed fields (ie those which will take longer to analyse) are not included. However, any Further fields of Alpha Type that have been defined and which are available to you as a user will be included, with their names prefixed by ‘FF:’.
If the option you need is not listed, the ‘All Flds’ check box to the right of the Analysis pop-up can be used to show all possible fields in the pop-up, except those that are Text, String longer than 31 characters, Picture, Subfile or Time fields. All Further fields of Numeric and Date Types will also now be listed. In the example illustration, if this check box was switched on, all fields in the Companies file would be shown in the Analysis pop-up menu.
With one exception, all Statistics View operations as described below can be carried out on Further fields, although if you are working with large selections the speed of some functions may be affected. The exception is that when choosing a Further Field from the Analysis pop-up no count for the number of records with a blank value in the chosen Further Field will be shown. For example, in the illustration above, the first, blank, line representing Companies with no Type would not appear if the selection in the Analysis pop-up were a Further Field. This is because Further fields effectively do not exist until they are asked to store a value.
Certain fields allow you to choose between displaying their ‘Codes’ or their ‘Names’. This is controlled by the two radio buttons underneath the Analysis pop-up menu. The effect of selecting the ‘Names’ option for Business Type is shown below. These radio buttons are greyed if there is no optional Name for the field you have chosen.
The ‘x Chars’ check box offers the ability to analyse the data by a chosen number of characters of that field, starting from the left. You could, for example, have Status Codes of C, CD and CS to represent different types of Client. Without turning on this check box, three Counts, for the number of Companies of each Status, would be listed, whereas if you turn on the option and choose 1 character, one Count would appear, comprising all Companies whose Status Code begins with C. This will be particularly useful for Product Codes, allowing them to be broken down into their Group, or Group and Brand components. Another good example would be specifying 2 characters in order to aggregate accounting Periods (95/01, 95/02 etc) into years. The text of the check box changes to show the last-specified number of characters, whether or not the feature is actually in use (ie the check box is checked). Note that the number of characters is calculated based upon the Codes, not the Names, and the ‘Names’ radio button is disabled if the ‘x Chars’ check box is switched on.
The File Names pop-up menu at the head of column two defaults to the name of the file you are viewing. This means that the Count column and the two numeric columns to its right will be calculated using data from this file. For example, an analysis of Companies by Type will Count the number of Company records in each of those Types. However, if the situation is appropriate, you may change the pop-up to show the name of a suitable related file. For example, in the illustration below the Count column shows the number of Sales Orders that are allocated to Companies of each of the Types, and columns three and four are showing calculations on numeric fields from the Orders file.
When initially selecting a different file from the FIle Names pop-up menu, all records in the new file relating to the original file are shown. Therefore, in the illustration above, all Sales Orders relating to the Companies previously listed are shown. If you want to perform a search on the related file, click the ‘Find’ check box. It may be turned on either before or after you select a related file from the pop-up above it. Either way, it comes up with the usual Quicksearch and, if necessary, More Choices, windows for the file you've chosen. In the case of Sales Orders within Companies, for example, you might choose to include only Confirmed Orders in the calculations. If you were working on Order items within Orders you might choose all items ‘Not Invoiced’ or similar. If you cancel before searching, the ‘Find’ check box will be turned off and the listing will return to showing all related records.
The ‘Find’ check box should not be confused with the [Find] button in the Palette, which is also available for use. The former is used just for related files (in this example Sales Orders), while the latter can be used in the normal way to perform a further search on the file you are viewing (in this case Companies).
Columns three and four are essentially identical, allowing two different calculations of numeric fields from the same file to take place. The upper of the pop-ups allows you to choose the mode of calculation - ‘Sum of’, ‘Average’, ‘Maximum’ or ‘Minimum’. The lower pop-up lets you choose the field on which you want the calculations to be based. The list only includes numeric fields - be they Integers, Long Integers or Real Numbers. included in the lower pop-up menus will be any available Further fields of Numeric Type, with the prefix ‘FF:’.
The final option on each of the numeric fields pop-ups is ‘Formula’.
This allows you to specify a formula for the calculations in very much the same way as ‘Edit a Formula’ does within the Report Generator. When you choose ‘Formula’, a small window appears into which you can type a one-line 4D function. The result of what you type must be a number, otherwise error messages will occur. You might, for example, want to work out 90% of the Sales Orders Margin Amounts for each your Analyses, in which case you would type: “[ORDERS]Total Margin*0.9”. You can only refer to fields within the file represented in the File Names pop-up. The Formula can also involve more complex calculations controlled by Macros, which can be done using the call of ‘Macro Result (“MacroCode”)’. Please refer to the Macros section of the Core Functions reference chapter for more details. Note that using formulae, and especially Macros, will considerably slow down the speed of calculation, especially multi-user. Each record has to be assessed individually, and then the results of the Formula for each are summarised.
Any of the columns may be sorted, using the button with the triangle icon.
While calculations are in progress you may use the <Command-.>/
The ‘Delay Recalc’ check box allows you to put on hold the recalculations of columns two, three and four. If you intend to change the pop-ups of all three of these columns, it is much more efficient for the calculations to be done together, so turn the check box on first, make your changes and then turn it off to force the calculations to be made. Otherwise, Enterprise 6 will attempt to recalculate after each change you make. Using the Analysis pop-up overrides and turns off this check box.
The choices you last made in the ‘Statistics View’ window for a particular file are remembered, and brought back, along with new calculations according to the selection, when you next View. This means that you can, for example, make a set of choices one morning, then repeat the analysis at different times of day without having to repeat the pop-up choices. All choices concerning cross-file calculations are not remembered, because they take some time to calculate and you may not want the default. Also, if you have chosen one of the non-default fields using the ‘Show All fields’ option, this will not be remembered, again for reasons of speed. You can force the system to completely forget these settings by selecting the ‘Statistics View’ menu option twice, effectively turning it off and then on again. You can also request that they are not used on any given occasion by




