[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| CALCULATE |
+---------------------------------+
CALCULATE <expr list>
[<scope>] [FOR <expL1>]
[WHILE <expL2>]
[TO <memvar list>
| TO ARRAY <array>]
[NOOPTIMIZE]
-----------------------------------
Performs financial and statistical operations on fields in database or
on expressions involving fields.
-----------------------------------
<expr list>
Contains any combination of these functions:
AVG(<expN>)
CNT()
MAX(<expr>)
MIN(<expr>)
NPV(<expN1>, <expN2> [, <expN3>])
STD(<expN>)
SUM(<expN>)
VAR(<expN>)
<scope>
Computes only for records that fall in range of records specified.
FOR <expL1>
Computes only records that satisfy logical condition <expL1>.
WHILE <expL2>
Includes records in calculation as long as logical expression <expL2>
evaluates to true.
TO <memvar list> | TO ARRAY <array>
Stores results of calculation to one or more memory variables or array.
If array doesn't exist it is created. If array exists and isn't large
enough it is expanded; if array is larger than necessary, its size is
reduced.
NOOPTIMIZE
Disables Rushmore.
Functions
---------
AVG
The AVG() option computes the arithmetic mean of a database field or
field expression. All records meeting the optional FOR or WHILE
conditions are included in the result.
CNT
The CNT() option returns the number of records in a database. If the
optional FOR or WHILE clauses are included, the number of records
matching the specified conditions will be returned.
MAX
The MAX() option returns the largest value of a field or field
expression. You may specify any numeric, character or date field within
the MAX() clause or any valid expression using these field types.
MIN
The MIN() option returns the smallest value of a field or field
expression. Any numeric, character or date field may be included or any
valid expression using these field types.
NPV
The NPV() option computes the net present value of a series of future
cash flows discounted at a constant periodic interest rate. <expN1> is
the interest rate expressed as a decimal value. <expr> is a field,
field expression or valid numeric expression representing a series of
cash flows. Each record in the field will be a cash flow, either
positive or negative. <expN2> is an optional initial investment. If
the initial investment <expN2> is not included, then the initial
investment is assumed to occur at the end of the first period. This
initial investment would be the first record in the field and would be
negative to represent a cash outflow. If the optional FOR or WHILE
clauses are used, only records that match the FOR or WHILE conditions
will be included in the NPV.
STD
The STD() option computes the standard deviation of the values in a
field or field expression. The standard deviation measures the degree
to which the field values differ from the average of all the values in
the field. The smaller the standard deviation, the less the values in
the field or field expression vary from the average. If the optional
FOR or WHILE clauses are used, only records that match the FOR or WHILE
conditions will be included in the calculation of the standard
deviation.
SUM
The SUM() option totals the values in a field or field expression. If
the optional FOR or WHILE clauses are used, only records that match the
FOR or WHILE conditions will be included in the SUM.
VAR
The VAR() option computes the variance from the average of a field or
field expression. The variance is the standard deviation squared. The
smaller the variance, the less the values in the field or field
expression vary from the average. If the optional FOR or WHILE clauses
are used, only records that match the FOR or WHILE conditions will be
included in the calculation of the variance.
+---------------------------------+
| Examples |
+---------------------------------+
USE customer
CALCULATE AVG(taxrate), MIN(taxrate), MAX(taxrate)
CALCULATE STD(taxrate), VAR(taxrate) TO mstdtax, mvartax
-----------------------------------
See Also: AVERAGE, COUNT, FV(), PAYMENT(), PV(), SUM
-----------------------------------
See Also:
AVERAGE
COUNT
FV()
PAYMENT()
PV()
SUM
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson