Skip to main content

Sort

Sort Function

Performs a nested sort operation on the provided table. Specify the columns to sort by name, as in [Customer.LastName] to use the LastName column of the Customer table followed by true or false for ascending or descending order respectively. The columns will be sorted in the order they are specified in.

Syntax

Sort (table Table, vector Column1, Column2,...)

Arguments

ArgumentDescription
table TableA table to be used as source material
vector Column1, Column2,...A list (vector) of the columns to sort the source table by, and whether they are to be sorted in ascending (true) or descending (false) order

Examples:

Sort([[Customer]], "State", true, "FullName", false)

Creates a new table using data from the customers table sorted by the state column in ascending order and sub-sorted by the fullname column in descending order.