ASC/DESC Order - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.5
Published
February 2018
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
qhj1503087326201.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

An “ASC/DESC Order” element can be used in a Sort Expressions folder with any of the Ordered Analytical functions to specify a sort direction, either ascending or descending. The appropriate SQL keyword, either ASC or DESC, is automatically added to the SQL generated for the expression placed under the “ASC/DESC Order” node in the tree. If an “ASC/DESC Order” is not used, the default sort direction is given, depending on the Ordered Analytical function in use.

An example of an “ASC/DESC Order” in a Sort Expressions folder is given below

Variable Creation > Input > expert options: SQL Elements pane > ASC/DESC Order

In order to set the sort direction, the user must either highlight the ASC/DESC Order node and click Properties, or double-click on the ASC/DESC Order node to display the following Properties dialog.

Variable Creation > Input > expert options: SQL Elements pane > ASC/DESC Order Properties

The Properties dialog presents two properties to set: Sort Order and Null Values in Sort Order. Sort Order defines the order in which values will be sorted, ascending from least to greatest or descending from greatest to least. Null Values in Sort Order defines where to put null values found during the sorting process. A selection of Nulls first puts null values before all other sorted values, while a selection of Nulls last puts null values after all other sorted values.

Clicking on OK causes the selected Sort Order and Null Values in Sort Order values to be used.