RollingSum / Computation Layer
Calculate the rolling (cumulative) sum over a sliding window. Similar to pandas.rolling().sum() or R's roll_sum().
Mathematical form: where is the window size and are optional weights.
Common applications:
- Running totals (revenue, costs)
- Cumulative counts (events, transactions)
- Resource usage tracking
- Rainfall accumulation
- Traffic volume analysis
- Energy consumption monitoring
- Inventory movement
Note: Useful for monitoring accumulations over fixed time windows.
Select
columnThe numeric column to compute rolling sums for. Typical applications:
- Sales volumes (daily totals)
- Transaction counts (hourly sums)
- Resource consumption (running totals)
- Event frequencies (occurrence counts)
- Cumulative measurements
WindowSize
u32Number of observations in sliding window. Common periods:
- 24: Daily totals from hourly data
- 7: Weekly accumulation
- 30: Monthly totals
- 365: Annual running sum
Choose based on reporting and analysis needs.
Weights
[f64, ...]Optional weights for window values. Must match window size if provided. Uses:
- Weighted accumulation
- Time-weighted totals
- Priority-based summation
Modifies contribution of each value to total.
MinPeriods
oneofRequire complete windows for sum calculation. Ensures totals are based on full windows of data. Important for accurate accumulation tracking and complete period totals.
Center
boolWindow label position. When true
, aligns to window center; when false
, to end. Effects:
true
: Better for historical accumulation analysisfalse
: Better for real-time total monitoring
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.