Top k Row Filter

The node behaves the same as a combination of the Sorter node followed by a Row Filter that only keeps the first k rows of the table except for the order of the rows which depends on the Output order settings. Note, however, that the implementation of this node is more efficient then the node combination above. In the dialog, select the columns according to which the data should be selected. For each column you can also specify whether a larger or smaller value is considered as superior.

Options

Sorting
A list of sorting critera.
  • Column: Sort rows by the values in this column. If you set multiple sorting criteria, the table is sorted by the first criterion. The following criteria are only considered, if the comparison by all previous criteria results in a tie.
  • Order: Specifies the sorting order:
    • Ascending: The smallest or earliest in the order will appear at the top of the list. E.g., for numbers the sort is smallest to largest, for dates the sort will be oldest dates to most recent.
    • Descending: The largest or latest in the order will appear at the top of the list. E.g., for numbers the sort is largest to smallest, for dates the sort will be most recent dates to oldest.
  • String comparison: Specifies which type of sorting to apply to the strings:
    • Natural: Sorts strings by treating the numeric parts of a string as one character. For example, results in sort order “'Row1', 'Row2', 'Row10'”.
    • Lexicographic: Sorts strings so that each digit is treated as a separated character. For example, results in sort order “'Row1', 'Row10', 'Row2'”.
Sort missing values to end
If selected, missing values are always considered to be smaller to present cells.
Filter mode
Specifies the mode for the top k selection of the output
  • Rows: Returns the top k rows based on their first occurrence in the input table.
  • Unique values: Returns all rows associated with the top k unique values.
Number of rows / unique values
The number of rows to select from the input table based on the specified mode.
Output order
Depending on the settings of the algorithm the order might change in the output and this option allows you to specify constraints on the order.
  • Sorted: The rows in the output are sorted according to the specified selection criteria.
  • Input order: The input order is reestablished for the rows returned by the algorithm. This requires sorting the output table.
  • Arbitrary: The rows are directly output in the order they are returned in by the algorithm. This option doesn't incur any additional runtime costs. Note: It is possible but not guaranteed that the output order is the same as the input order

Input Ports

Icon
Table to select rows from.

Output Ports

Icon
A table containing the top k rows.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.