 |
Online Help System
|
 |
Back to Brilliant Database Web-Site |
Write to Support |
Help Index
Functions for Recordset
...MathOp Functions
The following functions carry out operations (summation, subtraction, average
computing, etc.) over a set of database software records and differ only in the type of the source
of database software records.
- folMathOp (FolderID, FormID, |Field|,
|Operation|) - database software records are retrieved from the folder with FolderID.
- mmrMathOp (|RelationalField|, |Field|, |Operation|) -
database software records are retrieved from the many-to-many field (the RelationalField parameter).
- setMathOp (|VariableName|, |Field|, |Operation|) -
database software records are retrieved from the variable with the VariableName name.
- queMathOp (QueryID, FormID, |Field|,
|Operation|, Var1, Var2) - database software records are generated on the basis of the
query with QueryID. You can use the optional variables Var1 and Var2 to set the User Input query parameters.
The following 3 functions can be used only with the Report Styles or
Custom Export templates:
- repMathOp (|Field|, |Operation|) - operation over database software records selected in the report (for
printing).
- subMathOp (|Field|, |Operation|) -
operation over database software records grouped into the report (for
printing).
- cexMathOp (|Field|, |Operation|) - operation over database software records selected in Custom Export.
The Field parameter defines the database software record field over which the operation
is to be carried out.
The Operation parameter defines the operation itself. For example,
there are three database software records with values 1, 2 and 3. Then:
- Sum - sums values (1+2+3=6);
- SumOfSquares - calculates the sum of squares (1*1+2*2+3*3=14);
- SimpleAverage - calculates simple average ((1+2+3)/3=2)
;
- Quantity - returns the number of database software records (=3);
- Min - returns the smallest value of the set (=1);
- Max - returns the greatest value of the set (=3);
- First - returns the first value of the set (=1);
- Last - returns the last value of the set (=3)
.
Examples: Let's assume that we have 2 database software records in the folder with ID=7. The database software records use the form with ID=9 and have the Price field.
The Price field contains the following values: 3 and 4.
folMathOp(7,9,|Price|, |Sum|), returns 3+4=7;
folMathOp(7,9,|Price|, |SumOfSquares|), returns 3*3+4*4=9+16=25;
folMathOp(7,9,|Price|, |SimpleAverage|), returns (3+4)/2=3.5;
folMathOp(7,9,|Price|, |Quantity|), returns 2.
...RecN Functions
RecN functions are a particular case of the MathOp functions that return the number of database software records in the selection: folRecN, mmrRecN, setRecN, queRecN, repRecN, subRecN, cexRecN
|