maxp()

Read(204) Label: sequence, maximum value,

Here’s how to use maxp() function.

A.maxp()

Description:

Get the member of a sequence that makes the maximum value for the expression.

Syntax:

A.maxp(x)

Note:

The function computes expression x with each member of sequence A and returns the member which makes the maximum value for expression x.  

Options:

@1

Return the first member that fulfills the condition.

@a

Return all the members that fulfill the condition. By default, return what @1 gets.

@z

Search the member from back to front

Parameters:

A

A sequence

x

The expression to be computed

Return value:

The member which makes the maximum value for the expression x

Example:

 

A

 

1

[2,5,4,3,2,1,4,1,3]

 

2

=A1.maxp(~*~)

5, @1 is the default option

3

=A1.maxp@a(~*~)

[5]

4

=A1.maxp@z(~*~)

5

5

=A1.maxp@az(~*~)

[5]

6

=demo.query("select EID,NAME,BIRTHDAY from EMPLOYEE")

 

7

=A6.maxp(BIRTHDAY)

Related functions:

A.pmax()

A.minp()