Top / Bottom Rows

Find your best and worst rows by any column.

What it does

Top / Bottom Rows ranks your table by one column. It then shows only the best rows or only the worst rows. You choose the direction with Mode. You choose how many rows to see with Number of rows.

Show the top rows

  1. Type top in the Search transforms box, in the Pipeline panel.
  2. Select Top / Bottom Rows in the results list.
  3. Look at Mode. It is already set to top.
  4. Type a number in Number of rows.
  5. Open Sort by column (optional) and pick the column to rank by.
  6. Click Apply.

Example: a product table has a units_sold column. Set Number of rows to 10. Rank by units_sold. You get your 10 best sellers.

Switch to the bottom rows

Open Mode and select bottom. Keep the same column and the same count. Click Apply. You now get the 10 slowest sellers instead.

You can also edit the step later. Open it from the pipeline and flip Mode. The grid updates when you click Apply again.

If you skip the sort column

The sort column is optional. The result then depends on the mode:

  • top gives you the first rows of the table, in their current order.
  • bottom gives you the last rows of the table, in their current order.

This is a quick way to look at the tail of a file. Use it when no column ranks the rows for you.

For SQL users

With a sort column, top sorts high to low. The step runs as:

SELECT * FROM data ORDER BY "units_sold" DESC LIMIT 10
Try Top / Bottom Rows with sample data →

Related Operations