sort

sort, process option

The sort option orders a process call and returns only the final value.

Example

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

def process myConcat(t: text) with
  keep txt = ""
  txt = "\{txt}\{t}"
  return txt

x = myConcat(T.L) sort T.N
y = myConcat(T.L) sort -T.N

show summary "Sorted" with
  x
  y

This outputs the following summary:

x y
abc cba

Remarks

sort behaves like scan but only keeps the last value. auto ordering is not supported for sort, and the order of ties is unspecified.

See also

User Contributed Notes
0 notes + add a note