Home Search

DriveWorks Solo 22
TableSortByList

Send Feedback

TableSortByList

TableSortByList performs a sort on the specified column of the given table using the provided list.

Syntax

TableSortByList([Table or Table Name], [Column Index], [List], [Has Headers], [Ignore Case], [Sort Ascending])

Where:

Table or Table Name is a Table array (such as the data in a standard table, or the result of a QueryDataValues function).

Column Index is the column on which to base the sort. Number starting at 1 for the first column.

List is a pipe (|) delimited list of values to order by.

Has Headers is TRUE if the table has headers that shouldn't be included in the sort.

Ignore Case is TRUE to match list items regardless of case. FALSE to maintain case sensitivity.

Sort Ascending is TRUE to sort additional values in the column in ascending order, FALSE to sort in descending order.

Examples

RuleMeaning
TableSortByList(DwLookupDoorPrices,1,"Shaker|Flat|Full Glazed",TRUE,FALSE,TRUE)Will sort the data from the first column of the table DwLookupDoorPrices in the order of Shaker, Flat and then Full Glazed.

The header row will be excluded from the sort (maintained as a header row in the result).

Case sensitivity will be maintained.

The remaining values in the first column will be sorted in ascending order.

Example Table Data

Door StyleBase Price
Flat1
Shaker1.25
Full Glazed2
Multi Panel1.5
Half Glazed1.75

Example Result

The example above is returned as an array:

{"Door Style","Base Price";"Shaker","1.25";"Flat","1";"Full Glazed","2";"Half Glazed","1.75";"Multi Panel","1.5"}

Example Result As A Table

When viewed as a table the result will be as follows:

Door StyleBase Price
Shaker1.25
Flat1
Full Glazed2
Half Glazed1.75
Multi Panel1.5


See also

How To: Work With Arrays