Use this function to return the greatest decimal value from a group of fields which have names that begin with common characters.
MAX (PartialName, Section, Form, Group)
Parameter |
Description |
PartialName |
Enter a valid string. The string must be the common (prefix) portion of a set of field names that occur on the current section. The default is the current field. |
Section |
Enter the name of a section that contains the field named. The default is the current section. |
Form |
Enter the name of a form that contains the section and/or field named. The default is the current form. |
Group |
Enter the name of the form group that contains the form, section, and/or field named. The default is the current group. |
The system calculates and returns the average of the values of all fields that begin with the specified partial name. An example of field names that have a common start are:
Each of these fields is included if you specify the partial name using any of the leading characters of myfield. The first field will be excluded if you enter myfield2, but will match the other two field names.
The maximum is calculated by comparing all those fields that have values and have names matching the criteria. If all the field values are negative, then the result will be the negative number nearest the value zero. Note that zero (0) is a valid field value. Fields which have never been given a value are excluded from the calculation.
Note | Include the PartialName parameter. Fields must have unique names in a section. Using the default will probably not give the expected result, unless you created the form and understand the naming conventions. |
This table is used by the examples. The table represents the layout of two forms in the same group. Both forms share two sections (IMG A and IMG B). Each section has fields of the same name as a field in the other section.
Field |
Section |
Form |
Group |
Value |
MyField1 |
IMG A |
FRM A |
GRP |
100.24 |
MyField2 |
IMG A |
FRM A |
GRP |
200.16 |
MyField1 |
IMG B |
FRM A |
GRP |
98.60 |
MyField2 |
IMG B |
FRM A |
GRP |
* no value yet * |
MyField1 |
IMG A |
FRM B |
GRP |
0.00 |
MyField2 |
IMG A |
FRM B |
GRP |
* no value yet * |
MyField1 |
IMG B |
FRM B |
GRP |
70.77 |
MyField2 |
IMG B |
FRM B |
GRP |
* no value yet * |
Here are some examples:
(Assume the current field is MyField1, on the first section of the first form. Reference the previous table for field values.)
Function |
Result |
Explanation |
MAX ( ) |
100.24 |
Without any other information, the function will assume the current field and section. There will only be one value included in the search. |
MAX ("Myfield2") |
200.16 |
Again, there is only one field included in this result. |
MAX("MyField") |
200.16 |
In this example, the current section contains two fields that begin with the name "MyField". The second field has the greatest value. |
MAX("MyField", "IMG B") |
98.60 |
Although two fields on IMG B have a matching name, only one field actually has a value. |
MAX("MyField", , "FRM A") |
200.16 |
No section is specified in this example, so the entire form is searched. Four fields match the name criteria, but only three have values. |
MAX("MyField", "IMG B", , "GRP") |
98.60 |
This example specifies a section and group, but no form. There are four fields that match the name criteria, but only two have values. |
MAX("MyField", , , "GRP") |
200.16 |
This example names the group without a form or section. Eight fields meet the naming criteria, but only five fields actually have values. |
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.