Video | Tableau | Data visualisation | Analytics

What is the Window function in Tableau? Tableau Functions

The window is just an invisible box moving through your table, and once you understand the coordinates you control exactly what it aggregates.

Part ofTableau Functions
  • The window in any WINDOW_ function is defined by coordinates at the end of the expression, where 0 is the current row, FIRST is the start and LAST is the end, and everything between is aggregated.
  • The aggregation type (sum, average, etc.) is separate from the expression inside it — you can run WINDOW_AVG over a SUM([Sales]) for compound calculations.
  • Direction settings like table across, table down and table across then down dramatically change which cells fall inside the window.
  • Using pane across then down can force Tableau to scaffold data into empty cells, producing misleading results you almost never want.
  • Built-in quick table calculations such as moving averages are just window functions Tableau writes for you, and you can drag them out to reuse as calculations.

The window modifier is used commonly in Tableau to calculate totals, moving averages and sums and a range of other use cases. In this video, I walk through how windows work in Tableau in this first part of the explainer.The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If start and end are omitted, the entire partition is used.