What would you like to happen?
Summary
Add support in the Group By and ** Memory Group By** transforms to calculate a moving average over the last N events within each group.
Problem
Current aggregation functions operate on the full group only (e.g. sum, avg, min, max). There is no native way to compute a rolling/moving average within a group without additional steps or custom logic.
Proposed Solution
Introduce a new aggregation type:
- Moving Average (Last N Events)
With configuration options:
- Field to aggregate
- Window size (N)
- Order field (to define event sequence within the group)
Example
For a group customer_id, calculate:
- Moving average of
transaction_amount
- Over last
N = 5 events
- Ordered by
transaction_timestamp
Expected Behaviour
- Resets per group
- Respects defined sort/order field
- Outputs a new field with the rolling average
Benefits
- Simplifies common analytical patterns
- Reduces need for multiple transforms or scripting
- Improves readability and maintainability of pipelines
Additional Notes
- Should handle edge cases where fewer than N events exist (e.g. return null's for partial window)
- Performance considerations for large datasets should be taken into account
Issue Priority
Priority: 3
Issue Component
Component: Hop Gui
What would you like to happen?
Summary
Add support in the Group By and ** Memory Group By** transforms to calculate a moving average over the last N events within each group.
Problem
Current aggregation functions operate on the full group only (e.g. sum, avg, min, max). There is no native way to compute a rolling/moving average within a group without additional steps or custom logic.
Proposed Solution
Introduce a new aggregation type:
With configuration options:
Example
For a group
customer_id, calculate:transaction_amountN = 5eventstransaction_timestampExpected Behaviour
Benefits
Additional Notes
Issue Priority
Priority: 3
Issue Component
Component: Hop Gui