HP 3000 Manuals

At a Glance [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation


HP ALLBASE/BRW Reference Manual

At a Glance 

If you need to review some calculation terms, the following table may be
of help.

          Some Calculation Terms 
-------------------------------------------------------------------------------------------
|                                                                                         |
| Arguments         Arguments are the values used in a calculation.  Arguments include:   |
|                                                                                         |
|                                                                                         |
|                      *   items, standard items, and array items                         |
|                                                                                         |
|                      *   functions and standard functions                               |
|                                                                                         |
|                      *   function arguments                                             |
|                                                                                         |
|                      *   constants                                                      |
|                                                                                         |
|                      *   parameters                                                     |
|                                                                                         |
|                      *   column calculation results                                     |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Calculated Items  These are items created from a formula that you define.  Once         |
|                   created, calculated items can be used in a report just like an item   |
|                   projected from a Final Access Table or an HP ALLBASE/BRW standard     |
|                   item.                                                                 |
|                                                                                         |
|                   Calculated items are split into two categories:                       |
|                                                                                         |
|                                                                                         |
|                                                                                         |
|                      *   Table calculated items.  These are calculated items that you   |
|                          define from the Define Table Screen.  They are calculated when |
|                          the table is built.                                            |
|                                                                                         |
|                      *   Layout calculated items.  These are calculated items that you  |
|                          define from the Define Lines screen.  They are calculated      |
|                          whenever a lineset on which they appear is printed.            |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Calculations      A calculation uses arguments and operators to produce a result.       |
|                   Operators can perform mathematical or logical operations on           |
|                   arguments.  Arguments, operators, and results can be of several       |
|                   types.                                                                |
|                                                                                         |
|                   Calculations can be either formulas or conditions.                    |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Column            HP ALLBASE/BRW allows column calculations.  These let you specify,    |
| Calculations      for all the occurrences of an item:  the total, the average, the      |
|                   number of occurrences, or the largest/ smallest value.  Column        |
|                   calculations do not use formulas, and therefore do not use the        |
|                   Calculation Language.  You select a column calculation using the      |
|                   ColCalc field on the Define Lines screen.                             |
|                                                                                         |
|                   Column calculations are explained in Chapter 8.                       |
|                                                                                         |
-------------------------------------------------------------------------------------------

          Table 15-0.  Some Calculation Terms (cont.) 

-------------------------------------------------------------------------------------------

| Conditions        A condition is a calculation that produces a Boolean result, that is, |
|                   a result that can be either TRUE or FALSE. For example:               |
|                                                                                         |
|                                                                                         |
|                    (CUSTOMER-NO = 000004)                                               |
|                                                                                         |
|                   or                                                                    |
|                                                                                         |
|                                                                                         |
|                    ORDER-NO < "012"                                                     |
|                                                                                         |
|                   There are four types of condition in HP ALLBASE/BRW:                  |
|                                                                                         |
|                      *   Relation conditions.  You define relation conditions from the  |
|                          Define Table screen.  They determine whether or not to write a |
|                          record to a table.                                             |
|                                                                                         |
|                      *   Suppress line conditions.  These are used to determine whether |
|                          or not to print a line.                                        |
|                                                                                         |
|                      *   Suppress lineset conditions.  These are used to determine      |
|                          whether or not to print a lineset.                             |
|                                                                                         |
|                      *   Selection conditions.  These are used in Selection Sets to     |
|                          determine whether or not to select data for the report when    |
|                          the report is run.                                             |
|                                                                                         |
|                   Conditions are described in the section Formulas and Conditions.      |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Expressions       Expressions are calculations inside parentheses.  The HP ALLBASE/BRW  |
|                   Calculation Language lets you use expressions anywhere a single       |
|                   argument can be specified.                                            |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Formulas          A formula is any calculation where the resulting type is Integer,     |
|                   Real, String, Numeric, Date, or Time.  A formula is always specified  |
|                   as an expression, similar to the right side of an assignment          |
|                   statement in PASCAL or BASIC.                                         |
|                                                                                         |
|                   There are two types of formulas in HP ALLBASE/BRW:                    |
|                                                                                         |
|                      *   Calculated Items                                               |
|                                                                                         |
|                      *   Functions                                                      |
|                                                                                         |
-------------------------------------------------------------------------------------------

          Table 15-0.  Some Calculation Terms (cont.) 

-------------------------------------------------------------------------------------------

| Functions         A function is like a program procedure or subroutine.  You can use a  |
|                   function to avoid typing complicated formulas.  Functions can be used |
|                   in formulas or conditions; however, functions cannot be used as       |
|                   items.  Each function must have at least one argument, and can have   |
|                   up to nine.  A function argument is a value that can be passed to the |
|                   function when it is run.  There are three categories of functions:    |
|                                                                                         |
|                                                                                         |
|                                                                                         |
|                      *   Table functions.  These are functions that you define from the |
|                          Define Table screen.  A table function can only be used in     |
|                          calculations for the table from which it is defined.           |
|                                                                                         |
|                      *   Layout functions.  These are functions that you define from    |
|                          the Define Lines screen.  A layout function can only be used   |
|                          in calculations defined in the report layout, that is, in      |
|                          formulas created from the Define Lines screen, not in table    |
|                          calculations.                                                  |
|                                                                                         |
|                      *   Global functions.  These are functions that you define with    |
|                          the BRWSETUP program.  A global function can be used in any    |
|                          calculation in a report.                                       |
|                                                                                         |
|                   See Chapter 17, for more information on how to define global          |
|                   functions.                                                            |
|                                                                                         |
|                   See "How Calculated Items Work" in Chapter 19 , for a more         |
|                   technical description of how calculated items and functions work and  |
|                   how they affect performance.                                          |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Operators and     The term operator is used in the normal mathematical sense, that is,  |
| Operations        an operator is a mathematical or logical symbol that specifies an     |
|                   operation to be performed on an argument or arguments.  For example,  |
|                   the * symbol in a calculation is an operator that tells HP            |
|                   ALLBASE/BRW to multiply the PRICE by 10.  Operations can also be      |
|                   performed by functions.                                               |
|                                                                                         |
-------------------------------------------------------------------------------------------
|                                                                                         |
| Types             Arguments, operations, and calculation results can be one of the      |
|                   following 6 types.                                                    |
|                                                                                         |
|                   Numeric               Fixed-point decimal numbers                     |
|                   Integer               Numbers with no decimal part                    |
|                   Real                  Floating-point decimal numbers                  |
|                   String                Strings of characters                           |
|                   Time                  Values of hours, minutes, and seconds           |
|                   Date                  Values of day, month, and year                  |
|                                                                                         |
|                   HP ALLBASE/BRW includes standard functions that affect one or more of |
|                   the above types, for example, the function YEAR_OF will extract the   |
|                   year from any date value.                                             |
|                                                                                         |
-------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation