The Top/Bottom transform is used to set up rules on how data should be sorted and how many records are to be returned (combination of Sort transform and Record Sampling transform without the random generation).
The Top/Bottom transform requires 1 input transform that has at least 1 column.
The input could be a SQL Select transform, or the result of another transform. For example, we'll use the output of the Aggregate transform, as seen below:
2. Add the Transform
Steps to add the transform:
- Select the connector link.
- Select the transform from the menu.
- To Edit/Configue the transform, select the newly added transform, and click the Configure menu.
Steps to configure the Top/Bottom transform:
For example, you just want to return the Top 5 products in terms of OrderQty.
- Enter the number of Record Count.
- Select the Starting Point. Available options are Top (default) and Bottom.
- Select the columns you want to be included in the output.
- Drag and Drop the column(s) you want to include in the sorting key.
- Select the sorting order, either Ascending (default) or Descending.
Select Use Record Grouping if you want to return the indicated number of records for each group.
The figure below illustrates the output from the Top/Bottom transform.