Tip: See "Computed Fields" if you are looking for information about computed fields.
A "Stats Box" is a different type of computed field which you can place on top of a record list window in order to display some statistical information
about all of the currently displayed records. Its configuration is very similar to a computed field
but it uses a different set of built-in math functions.
You can add more than one stats box. However, keep in mind that SpeedBase will automatically hide stats boxes starting from the most right side
position if there is not enough horizontal space to fit them all. You may consider to resize / maximize the window in that case.
Note that you should type a dot, not comma, when you need to use decimal marks.
In the example picture below, the sum of all payments of the displayed records is calculated by a stats box with an expression of
Creating / Updating Stats Boxes
Box Width: Adjust the width of the output box in pixels.
- From the catalog tree, right click the catalog name, select "Design Toolbar & Stats" from the popup menu,
This will open "Toolbar Designer"
- Click the button "New Stats Box" (or select an existing one if you want to update),
- Enter an expression into the expression box, save and exit
- A new stats box will be displayed now on top of the record list window.
Label: Enter a descriptive name to be displayed with the stats box.
Align: The stats box can optionally be aligned to the right side of the window.
Invisible: Hide the stats box.
Available functions and examples are given below. Function names are not case sensitive.
Special Functions Dedicated to Stats Boxes
RecordCount or RecordCount("ViewName")
Returns the number of records existing in the specified view whose name is given in quotes. You can call it without the view name parameter
if you need the number of records in current view.
FieldSum("FieldName") or FieldSum("FieldName", "ViewName")
Returns the numeric sum of the field specified in quotes for all of the records currently listed.
Assume that you have a "Tasks" catalog and you save the time spent for each task into a numeric field named as "Hours".
This expression will show the total hours spent for all tasks listed in current view.
Assume that you have a "Expenses" catalog, where you record all expenses into the field name "cost".
Assume also that you have created the view "Expenses in last week" and assigned a filter to it which displays only the records created in last week.
This expression will show the total expense in last week.
FieldSum("cost","Expenses in last week")
FieldAvg("FieldName") or FieldAvg("FieldName","ViewName")
Returns the numeric sum of the field specified in quotes divided by the number of records currently listed.
Used exactly in the same way as FieldSum function.
All other Functions
Consult the following document for the full list of functions supported by vbscript engine:
Function Reference for VBscript
If you are unsure how to build the right expression, request support.