Server User Guides > Survey Tabulation > Cell contents > Sorting rows and columns > Sorting nested and concatenated tables
 
Sorting nested and concatenated tables
Concatenation
When you sort a table that contains concatenation in the dimension in which you are sorting, the elements within each variable are sorted separately. For example, the following table uses the Museums sample data set, with Age and Gender concatenated on the side axis, and Biology and Before on the top axis. The rows are sorted by their values in the Before column. To do this, you select before{Base} from the Column Sorting list box in the Preferences tab. For more information, see To sort a table on a row or column.
Here is the table, with the sort column highlighted:
Concatenated table sorted on base Before column
This graphic is described in the surrounding text.
The rows that relate to the Age variable have been sorted separately from the rows that relate to the Gender variable.
Nesting
If there is nesting in the dimension of the table in which the sort row or column is located, the sorting list boxes display the combined sort options. In the following nested table, the rows are sorted on the Base element of the Before variable that is nested within the Yes element of the Biology variable. To do this, you select the biology{Yes} > before{Base} option from the Column Sorting list box.
Here is the table, with the sort column highlighted:
Nested table sorted on base Before column
This graphic is described in the surrounding text.
Note that the sort order would be different if you sorted the rows on the Base element of the Before variable that is nested within the No element of the Biology variable.
When you sort a table that contains nesting in the dimension in which you are sorting, the elements within the inner variables are sorted. However, the elements of the outermost variable are not sorted. For example, the following table has Education nested within Interview on the side axis, by Gender on the top axis. The rows of the table are sorted by the values in the base Gender column. To do this, you select the Gender{Base} option from the Column Sorting list box.
Here is the table, with the sort column highlighted:
Nested table sorted on base Gender column; outermost variable is unsorted
This graphic is described in the surrounding text.
Combination of nesting and concatenation
You cannot sort an axis that contains a combination of nesting and concatenation. However, you can use that axis to sort the other axis of the table (provided that this does not also contain both nesting and concatenation).
See also
Sorting net elements
Sorting special elements
Sorting grid tables
To sort a table on a row or column
Sorting rows and columns