The sort option specifies an ordering for an aggregation. It can be applied to either a process function call or an aggregator call.
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
// abc, cba
show summary "" with x, y
sort acts in the same way as scan, except that it only returns the last value of computation. Consult the documentation of scan for more information.
Unlike scan, auto ordering is not supported for sort.