5-4-5 Statistical functions
In statistical functions, the argument is specified with a field inside a "Repeat" used as a detail line, or with a field inside a detail record.
Five types of functions are provided for each usage.
Type | Behavior |
---|---|
Basic functions | When the mode of the VrSetForm function is 1, the data from the beginning of the page up to where the VrEndPage function is output is treated as the target data for statistical processing. When the mode of the VrSetForm function is 4 or 5, the data up to the key-break of the specified key is treated as the target data for statistical processing. |
P-type functions | The data within a page break unit is treated as the target data for statistical processing. You cannot use P-type functions in calculation-formulas. |
R-type functions | These are valid only when the mode of the VrSetForm function is 4 or 5. The cumulative total is calculated. The value is restored to "0" when a key-break is encountered for a key field with Clear accumulated value selected in its properties. |
G-type functions | These are valid only when the mode of the VrSetForm function is 4 or 5. All of the data is used as the target for statistical processing. |
Conditional Functions | These are valid only when the mode of the VrSetForm function is 4 or 5. The data meeting the specified conditions is used as the target for statistical processing. |
Reference
For detailed explanations of the VrSetForm and VrEndPage functions, see "SVF Java PRODUCTS API Reference Manual".
Statistical functions cannot handle fields that use statistical functions.
Function name | Feature |
---|---|
Calculates the total value in numeric fields. | |
Calculates the average value in numeric fields. | |
Calculates the minimum value in text and numeric fields. | |
Calculates the maximum value in text and numeric fields. | |
Calculates the total number of output data items in text and numeric fields. |
SUM / PSUM / RSUM / GSUM
Feature | Calculates the total value in numeric fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | There are basic, P-type, R-type, and G-type functions provided corresponding to each usage. For details of the differences between the operations according to each function type, see "List of operations by function type". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Settings | In "numeric_field_name", specify the name of the numeric field that contains the numeric data to be totaled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage examples | Prerequisite When designing as follows and executing with the Report-writer mode (4 or 5) of the VrSetForm function
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Result | ![]() The value of SUM is the result of summation on the record. When calculations are performed outside of records, the entire data will be the target. In the RSUM calculations, all records are included in the calculation of the cumulative total, as Clear accumulated value is not specified in this design example. Restriction
|
AVG / PAVG / RAVG / GAVG
Feature | Calculates the average value in numeric fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | There are basic, P-type, R-type, and G-type functions provided corresponding to each usage. For details of the differences between the operations according to each function type, see "List of operations by function type". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Settings | In "numeric_field_name", specify the name of the numeric field that contains the numeric data to be averaged. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage examples | Prerequisite When designing as follows and executing with the Report-writer mode (4 or 5) of the VrSetForm function
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Result | ![]() The value of AVG is calculated using data in records. When calculations are performed outside of records, the entire data will be the target. In the RAVG calculations, all records are included in the calculation of the cumulative total, as Clear accumulated value is not specified in this design example. RestrictionIf you have selected Clear accumulated value for multiple keys, the values are restored to "0" at every key-break of the keys you specified. This means that you cannot retrieve the values retained for each key. |
MIN / PMIN / RMIN / GMIN
Feature | Calculates the minimum value in text and numeric fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | There are basic, P-type, R-type, and G-type functions provided corresponding to each usage. For details of the differences between the operations according to each function type, see "List of operations by function type". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Settings | In "field_name", specify the name of the field that contains the numeric data from which to retrieve the minimum value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage examples | Prerequisite When designing as follows and executing with the Report-writer mode (4 or 5) of the VrSetForm function
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Result | ![]() The value of MIN is calculated using data in records. When calculations are performed outside of records, the entire data will be the target. In the RMIN calculations, all records are included in the calculation of the cumulative total, as Clear accumulated value is not specified in this design example. RestrictionIf you have selected Clear accumulated value for multiple keys, the values are restored to "0" at every key-break of the keys you specified. This means that you cannot retrieve the values retained for each key. |
MAX / PMAX / RMAX / GMAX
Feature | Calculates the maximum value in text and numeric fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | There are basic, P-type, R-type, and G-type functions provided corresponding to each usage. For details of the differences between the operations according to each function type, see "List of operations by function type". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Settings | In "field_name", specify the name of the field that contains the numeric data from which to retrieve the maximum value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage examples | Prerequisite When designing as follows and executing with the Report-writer mode (4 or 5) of the VrSetForm function
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Result | ![]() The value of MAX is calculated using data in records. When calculations are performed outside of records, the entire data will be the target. In the RMAX calculations, all records are included in the calculation of the cumulative total, as Clear accumulated value is not specified in this design example. RestrictionIf you have selected Clear accumulated value for multiple keys, the values are restored to "0" at every key-break of the keys you specified. This means that you cannot retrieve the values retained for each key. |
COUNT / PCOUNT / RCOUNT / GCOUNT
Feature | Calculates the total number of output data items in text and numeric fields. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | There are basic, P-type, R-type, and G-type functions provided corresponding to each usage. For details of the differences between the operations according to each function type, see "List of operations by function type". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Settings |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage examples | Prerequisite When designing as follows and executing with the Report-writer mode (4 or 5) of the VrSetForm function
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Result | ![]() The value of COUNT is calculated using data in records. When calculations are performed outside of records, the entire data will be the target. In the RCOUNT calculations, all records are included in the calculation of the cumulative total, as Clear accumulated value is not specified in this design example. RestrictionIf you have selected Clear accumulated value for multiple keys, the values are restored to "0" at every key-break of the keys you specified. This means that you cannot retrieve the values retained for each key. ReferenceIn the COUNT function, you can retrieve the number of unique values in the specified field by specifying the field name with @ as the parameter. You can specify such a name in all formats of the COUNT functions. For example, with the data in the above-mentioned examples, use the following setting to retrieve the number of unique values from the data in the CODE field up to the key-break, as the value of the "GROUP_CT" field:
|