min()

Read(673) Label: min,

Here’s how to use min() function.

A .min()

Description:

Compute the minimum value of all the non-null members in a sequence.

Syntax:

A.min()

Equivalent to min(x1,…,xn)

Note:

The function computes the minimum value of all the non-null members in sequence A. Note that this function doesn’t apply to a sequence whose members are of different data types.

Parameter:

A

A sequence

Option:

@0  Do not ignore null

Return value:

The minimum value of all members in sequence A

Example:

 

A

 

1

=[8,-6,1,3,5].min()

-6

2

=["c","b","e","A"].min()

"A"

3

=["a",1].min()

An error message will be displayed because members are of different data types

4

=["a",null,"b"].min()

"a"

5

=min("c","b","e","A")

"A"

Related function:

A.sum()

A.avg()

A.count()

A.min(x)

A.max()

A .min( x )

Description:

Compute x with each member of the sequence and then find the minimum value of the members of the new sequence

Syntax:

A.min(x)

Equivalent to A.(x).min()

Note:

The function loops through each member of sequence A to compute expression x and return the minimum value of members of the resulting sequence.

Parameter:

A

A sequence

x

Generally, an expression of a single field name, or a legal expression composed of multiple field names.

Return value:

The minimum value of all members after computations have been performed on sequence A.  

Example:

 

A

 

1

=demo.query("select * from EMPLOYEE")

 

2

=A1.min(SALARY)

Compute the lowest non-null value of SALARY

3

=A1.(SALARY+100).min()

Add 100 to the salary of each employee and then compute the lowest salary

Related function:

A.min()