Specifying Sorts

How to:

Reference:

You can specify a sort to determine the order in which new columns appear in the results. A sort orders your results according to the results of a column you choose. When sorting by multiple columns, the first sort field sets the major sort break, the second sets the second sort break, and so on.

A sort is useful only in some cases. Use the following guidelines to consider whether or not to include a sort in your data flow.


Top of page

x
Procedure: How to Specify a Sort
  1. From the data flow workspace, right-click the SQL object and select Sort.

    The Sort Columns dialog box opens.

  2. Double-click the column you want to sort on.

    or

    Select the column you want to sort on and click the right arrow.

    The column is added to the Sort Columns box.

  3. Optionally, change the order in which the results will be sorted by clicking the drop-down menu under the Order column and selecting an order.
    • ASC (ASCENDING) sorts the results from lowest to highest. This is the default.
    • DESC (DESCENDING) sorts the results from highest to lowest.
  4. Optionally, if you select more than one column, you can change the dominant sort by using the up and down arrows to move the columns up and down in the list.
  5. Click OK.

Note: Clicking a column heading will sort the column grid on that heading.


Top of page

x
Reference: Sort Columns Window

To access the Sort Columns window from the data flow workspace, right-click the SQL object and select Sort.

Sort Column Window

The Sort Columns window contains the following fields and options:

Available Columns

Is a list of columns available in the data source.

Source Column

Is the name of the column.

Format

Is the format of the column.

Description

Is a description of the column.

Note: Clicking a column heading will sort the column grid on that heading.

Nulls

Indicates if the column can contain NULL values.

Sort Columns

Is a list of sort columns.

Order By

Is the column(s) that sorts the results.

Order

Specifies whether results are sorted in ascending or descending order.

Aggregate

Is the column aggregation, if one has been applied.

Right and Left arrows

Add or remove sort columns.

Find button Find

Allows you to search for a column.

Test SQL Statement button Test SQL Statement

Tests the SQL statement and displays the result.

Note: The test button will be grayed out if you have not selected any columns.

Up and Down arrows

Move the selected sort column to change the order of the sort breaks.


iWay Software