Window Function

Rank, row number, lead, lag

What It Does

Window Functions compute values across related rows without collapsing them. Add rankings, running totals, or access adjacent row values.

How to Use It

Opening the Panel

Click the + button in the toolbar or press the operation picker, then search for "Window Function". It's in the Aggregate group.

Configuration

FieldTypeRequiredDescription
FunctionSelectYesrow_number, rank, dense_rank, lead, lag, running_total, sum, avg, min, max
ColumnColumn selectFor value functionsThe column to compute over
Partition byColumn selectNoReset the window for each group
Order byColumn selectRecommendedSort rows within each partition
SQL generated under the hood
SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY revenue DESC) AS rank FROM data
Try this operation →

Related Operations

  • Pivot - Pivot table (rows to columns)
  • Smallest - Get nth smallest value as a column
  • Largest - Get nth largest value as a column