MovingMax
Calculates the moving maximum value within a specified window of rows relative to the current row.
Category: window
Syntax:
MovingMax([column], window_start, window_end)
Returns: Same as input type
Context Filtering: ✓ Yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
column |
column |
✓ Yes | The numeric column to calculate moving maximum for |
window_start |
integer |
✓ Yes | The number of rows before the current row to include in the window (negative value) |
window_end |
✗ No | integer |
The number of rows after the current row to include in the window (positive value). Defaults to 0. |
Allowed Column Types for column: INT, FLOAT, DECIMAL, NUMBER
Validation
- Minimum parameters: 2
- Maximum parameters: 3
Examples
MovingMax([Sales], -6, 0)
Returns the highest sales value in a 7-day rolling window (current row and 6 previous rows).
MovingMax([Temperature], -13, 0)
Calculates a 14-day moving maximum temperature, useful for tracking peak temperatures over time.
MovingMax([Stock_Price], -4, 4)
Calculates a centered 9-day moving maximum (4 days before, current day, 4 days after).
Related Functions
- CumulativeMax - Calculates cumulative maximum from the first row
- MovingMin - Calculates moving minimum with a window
- Max - Returns the overall maximum