The Top N node is used to filter a given table by the top n number of rows. The Top N node must be connected to a Select node or an SQL Query node; you can then specify the number of top rows to be returned in the resulting table. For other filter types, use the Filter node from the Preparation functions.
Configure the Top N Node
Connect the Top N node to a Select or SQL Query node and go to the Properties panel. Specify the number of top rows to be returned in the resulting table (green arrow below). You can rename the table (blue highlight), determine which columns to include in the table from the Column Selection, set incremental loading, and add a description to the node.
In the image below, the Top N node was connected to an SQL Query node to return the top 150 rows in the table returned by the SQL query:
Preview Result Set
The result set of Top N node can be previewed by clicking on the node, and then clicking the preview icon from the node's Properties panel, or from the Preview panel. By default, the preview is limited to the first 50 rows, but this can be changed from the Preview Size drop down in the ribbon.
- Click here to learn more about the Preview panel.
Expand the Column Selection window to update the column selection for the given table. By default, all columns in the table are selected but you can remove columns by deselecting them. Columns that have been deselected will not be copied to the new data model.
Expand the Set Variable Values window to pass a variable to the node. To do this, click the plus sign and then select the relevant variable, the aggregation type, and the relevant column.
Expand the Description window to add your own description to the node's properties. This is useful for keeping track of the ETL process, especially if multiple users are working with the same ETL.