Hierarchical sort between lists, for example, [0, 1] < [0, 2] <
[1, 0]. The sorting criteria following the Tree
Sorter allow you to choose the sorting for the child nodes of the same
parent node.
The configuration asks for 3 elements:
A sort expression to get the comparable value.
The sort order: ASC/DESC.
Handle NULL elements: LAST/FIRST.
To sort by multiple attributes, specify a list of sorters. You can sort by an attribute in
ascending order and then by another attribute in descending order. The second sort applies
to the attributes retained by the first sort.
For example, to sort tickets by status and then by descending ticket id:
There is one input. There are no constraints on the element type or on the number of
elements in the stream.
Output
There is one output. The output stream counts as many elements as the input stream. It does
not modify the elements. Only the order in the stream might change.
Example
In this example, we sort the employees by salary.
The output stream is ordered.
Multiple Sorters
Important:
With a SORT operator, the result order can
change when you run the data query again (if several persons have the same salary in the
example above). The data query View offers a stable result order by
choosing an arbitrary order that does not change when you run the data query again.