Description:
Get positions of members holding the minimum value in a sequence.
Syntax:
A.pmin(x)
Note:
The function computes expression x with each member of sequence A and returns the sequence numbers of the members whose computations are the minimum. Can be used to find the positions of the minimum value in a sequence.
Parameter:
A |
A sequence |
x |
A field name or an expression, in which "~" is used to reference the current record |
Option:
@a |
Return sequence numbers of all members that make expression x get the smallest value |
@z |
Perform the search backwards from the last member; by default, perform the search from the first member |
@0 |
Do not skip null members |
Return value:
Sequence number/Sequence composed of sequence numbers
Example:
|
A |
|
1 |
[2,5,4,3,2,1,4,1,3] |
|
2 |
=A1.pmin(~*~) |
6 |
3 |
=A1.pmin@a(~*~) |
[6,8] |
4 |
=A1.pmin@z(~*~) |
8 |
5 |
=A1.pmin@az(~*~) |
[8,6] |
6 |
=demo.query("select * from EMPLOYEE") |
|
7 |
=A6.pmin(BIRTHDAY) |
296 |
8 |
=[4,6,1,2,null,7].pmin@0() |
5 |
Related function: