Skip to main content

What This Node Does

The Window node performs calculations across rows using window functions. Unlike aggregations that collapse rows into groups, window functions preserve all rows while adding calculated columns based on ordered sets of rows (windows). Use it for running totals, rankings, moving averages, and row-by-row comparisons. [SCREENSHOT: Window node on canvas showing “Added 3 window calculations: running_total, rank, moving_avg”]

When to Use This Node

Use the Window node when you need to:
  • Running totals - Cumulative sum of revenue over time, year-to-date totals
  • Rankings - Rank customers by spend, rank products by sales
  • Moving averages - 7-day moving average, 3-month rolling average
  • Compare rows - Change from previous month, LAG/LEAD for period-over-period analysis

Step-by-Step Usage Guide

1

Add Window node to canvas

2

Connect to upstream data

3

Choose window function

Select function type: SUM, AVG, COUNT, RANK, ROW_NUMBER, LAG, LEAD, etc.[SCREENSHOT: Function type dropdown]
4

Select column to calculate

Choose which column to apply the function to (e.g., revenue, sales_amount)[SCREENSHOT: Column selector]
5

Configure Order By

Specify ordering for the window (e.g., order by date ascending for running total)[SCREENSHOT: Order By configuration]
6

Set Partition By (optional)

Split into separate windows per group (e.g., partition by region for separate running totals)[SCREENSHOT: Partition By selector]
7

Configure window frame (optional)

For moving calculations, set frame (e.g., 6 PRECEDING to CURRENT ROW for 7-day average)[SCREENSHOT: Window frame configuration]
8

Name the output column

Enter descriptive name (e.g., running_total, sales_rank, moving_avg_7d)[SCREENSHOT: Column name input]
9

Preview results

Tips and Best Practices

Sort Before Window: Use Sort node before Window to ensure correct ordering. Window functions respect input row order.
Partition for Groups: Use Partition By to calculate separately per group (region, category, customer). Without partition, calculation runs across all rows.
Frame for Moving Calculations: Set custom frame for moving averages, rolling sums. Default is UNBOUNDED PRECEDING (running total). Use “N PRECEDING to CURRENT ROW” for moving N-period average.
RANK vs DENSE_RANK: RANK leaves gaps for ties (1, 2, 2, 4). DENSE_RANK has no gaps (1, 2, 2, 3). Choose based on your needs.
Window + Formula Pattern: Window calculates base values (totals, previous values). Formula derives insights (percentages, change). Example: Window for LAG → Formula for “current - previous”.
LAG/LEAD for Comparisons: Use LAG to access previous row values, LEAD for next row. Perfect for month-over-month or period-over-period comparisons.