Icon

Top k Selector

The Top k Selector is like a combination of the Row Sampling and Sorter nodes. The user gives a specified number of rows to sample from the top of the table. However, it can also sort the data at the same time. For example, you can return the top 10 largest values, even if the data is not already sorted in that order.

On the Advanced tab, you can also elect to return the output table sorted, in the given row order, or in arbitrary order.

The Top k Selector is more efficient than using a combination of Row Sampling and Sorter nodes.

Top k Selector The Top k Selector is like a combination of the Row Sampling and Sorter nodes. Theuser gives a specified number of rows to sample from the top of the table. However, itcan also sort the data at the same time. For example, you can return the top 10 largestvalues, even if the data is not already sorted in that order.On the Advanced tab, you can also elect to return the output table sorted, in the givenrow order, or in arbitrary order.The Top k Selector is more efficient than using a combination of Row Sampling andSorter nodes. The default settings are to return a set number ofrows with the output row order not defined. Night Heron Data, 2023 Sorting by multiple columns is called a nested sort.Here, we sorted Country, Region, and StateName allin ascending order. This means that all Countryvalues are sorted first. Then, within each Countryvalue, each Region value is sorted. Finally, eachStateName value is sorted within each Region withineach Country. You can also return according to unique values.Here, we configured the node to return the top 3unique values from the Region column. This settingreturns ALL records associated with the top 3 uniquevalues from the selected column. Input some dataTop 10 byPopulation,no sortTop 10 byPopulation, sort output descendingReturn top 3unique values Table Creator Top k Selector Top k Selector Top k Selector Top k Selector The Top k Selector is like a combination of the Row Sampling and Sorter nodes. Theuser gives a specified number of rows to sample from the top of the table. However, itcan also sort the data at the same time. For example, you can return the top 10 largestvalues, even if the data is not already sorted in that order.On the Advanced tab, you can also elect to return the output table sorted, in the givenrow order, or in arbitrary order.The Top k Selector is more efficient than using a combination of Row Sampling andSorter nodes. The default settings are to return a set number ofrows with the output row order not defined. Night Heron Data, 2023 Sorting by multiple columns is called a nested sort.Here, we sorted Country, Region, and StateName allin ascending order. This means that all Countryvalues are sorted first. Then, within each Countryvalue, each Region value is sorted. Finally, eachStateName value is sorted within each Region withineach Country. You can also return according to unique values.Here, we configured the node to return the top 3unique values from the Region column. This settingreturns ALL records associated with the top 3 uniquevalues from the selected column. Input some dataTop 10 byPopulation,no sortTop 10 byPopulation, sort output descendingReturn top 3unique values Table Creator Top k Selector Top k Selector Top k Selector

Nodes

Extensions

Links