> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Window functions

> Rank rows and read values from neighbouring rows within a window. Aggregate functions can also run over windows.

Rank rows and read values from neighbouring rows within a window. Aggregate functions can also run over windows.

| Function | Type | What it does |
| - | - | - |
| [`cume_dist`](/query/sql/functions/window/cume_dist) | Window | Returns the fraction of rows in the group that come before or tie with the current row in the specified order. |
| [`dense_rank`](/query/sql/functions/window/dense_rank) | Window | Returns consecutive ranks without gaps for equal ordering values. |
| [`lag`](/query/sql/functions/window/lag) | Window | Returns a value from an earlier row in the same group defined by PARTITION BY. |
| [`lead`](/query/sql/functions/window/lead) | Window | Returns a value from a later row in the same group defined by PARTITION BY. |
| [`ntile`](/query/sql/functions/window/ntile) | Window | Divides the ordered rows in each group into buckets as evenly as possible. |
| [`rank`](/query/sql/functions/window/rank) | Window | Returns ranks with gaps after equal ordering values. |
| [`row_number`](/query/sql/functions/window/row_number) | Window | Assigns consecutive row numbers starting at 1 within each group defined by PARTITION BY. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.