Column Sorting
Each column must be sorted by a given column. Sorting can also be applied in the Data Flow; this type of sorting is stored in the database schema. Sorting applied from the Columns panel, however, is executed at runtime.
By default, each column is sorted by itself. However, each column can be sorted by any column within its table. If the sorting column is text-based, the sorted column will be sorted in alphabetical order. If the sorting column is numeric, the sorted column will be sorted from in increasing order.
How to Sort Columns
Each column's sorting is displayed in the Sort column. By default, each column is sorted by itself.
You can change the sorting for a given column from the Sort drop-down list. The Sort drop-down exposes all columns in the current table; each column may be sorted by any other column from the same table.
Sorting by a Different Column
there are many scenarios in which it's preferable to sort by a different column. For example, certain time intelligence columns are not sorted by themselves. Columns like Full Quarter, Full Month Name, and Weekday Name must be sorted by numeric columns that contain the start dates or numeric values.
Another example may be sorting customers by their purchases, in order to get a list of customers ordered from most purchases to least purchases.
Take, for instance, the Full Month Name column, which lists month name and year, which, is automatically sorted by the Full Month Start Date column by default. If this column is sorted by itself, it will be sorted alphabetically:
However, we want the column to be sorted in chronological order. To achieve this, we need to sort the month names by a numeric column. If we try sorting by Month Number, however, we end up with multiple rows for each month-year value:
Again, we want to sort the Full Month Name chronologically. If we sort by the Full Month Start Date Column, we end up with a list of months in the correct chronological order:
Alternatively, let's take a look at the Month Name column, which is sorted by the Month Number column by default. Again, if this column is sorted by itself, we end up with month names sorted alphabetically:
However, when we sort by Month Number, we get a list of month names in their correct order: