arglast

arglast, function

def vector arglast(): boolean

Returns true for the last value of the group according to the ordering. The group is optional. When the group is provided, the function returns true once per group.

Examples

table T = with
  [| as N, as G |]
  [| 0, "b" |]
  [| 3, "a" |]
  [| 2, "a" |]
  [| 1, "a" |]

T.A = arglast() sort T.N
T.B = arglast() by T.G sort T.N

show table "" with
  T.N
  T.G
  T.A
  T.B

Output:

N G A B
0 b false true
3 a true true
2 a false false
1 a false false

Remarks

arglast() is used with the sort option to identify the last element in an ordered list. When used with grouping (via by), it returns a boolean vector with one true value per group.

See also

User Contributed Notes
0 notes + add a note