Table Row/Column Sort

The Table Row/Column Sort generator looks at all of the input table Items and for each one, applies a hierarchical sort to the rows and/or columns of the table. There is one output table for every input table.

The template always attempts to sort numerically first, regardless of the type of data in the table item. If this sort is not possible, then alphabetic sorting is performed.

Configuration Options

There are a few configuration options for this generator.

OptionDescription
New table nameSets the name for the generated table(s). The table name can include macro expansions and uses the current data item to access additional macro sources (for example, tag values).
Select columns to sort rows byOpens a row or column sorting editor. This editor is the same dialog as used for sorting data items in layouts. There are separate buttons used to set the sorting rules for the rows and columns. These rules are applied independently. Rows or columns can be sorted using values in specific columns or rows respectively. You can also select Labels to specify that the values of the column or row labels be used to sort the rows or columns.
Select rows to sort columns by

Example

This example targets a single table and uses a template layout that looks like this:

The top level template simply filters the input down to one table to process. The raw table is displayed by the Unsorted panel template. The start of the output looks like this (there are many more rows not displayed here):

The Sorted template is an instance of the Table Row/Column Sort generator. It sorts the columns using the labels for the columns sorting in an increasing fashion left to right. The Select rows to sort columns by configuration looks like this:

The Select columns to sort rows by configuration looks like this:

When considering the proper order of the rows, this configuration specifies that the User column value is the primary sort key. If there is a tie, the Version column value is used, and if there is still a tie, the Date column value is used. In all cases, the sort is performed from smallest to largest value.

The resulting sorted table is displayed like this: