You are here: Function Reference > Alphabetical Listing > M > MIN

MIN

Use this function to return the least decimal value from a group of fields which have names that begin with common characters.

Syntax

MIN (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. 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 minimum is calculated by comparing all those fields that have values and match the naming criteria. If all the values are negative, then the result will be the negative number most distant the value of 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 within a section. Using the default will probably not give the expected result, unless you created the form and understand the naming conventions.

Example

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

MIN ( )

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.

MIN ("MyField2")

200.16

Again, there is only one field included in this result.

MIN("MyField")

100.24

In this example, the current section contains two fields that begin with the name MyField. The first field has the least value.

MIN("MyField", "IMG B")

98.60

Although two fields on IMG B have a matching name, only one field actually has a value.

MIN("MyField", , "FRM A")

98.60

No section is specified in this example, so the entire form is searched. Four fields match the name criteria, but only three have values.

MIN("MyField", "IMG B", , "GRP")

70.77

This example specifies a section and group, but no form. There are four fields that match the name criteria, but only two have values.

MIN("MyField", , , "GRP")

0.00

This example names the group without a form or section. Eight fields meet the naming criteria, but only five fields actually have values. The least of these five contains the value 0.00.

See also