User Tools

Site Tools


transformations:slidingaggregation

SLIDING AGGREGATION

Category: Transform / Advanced


Description

This action calculates an aggregate, such as average, of N sliding values.

Available aggregations:

  • Average
  • Sum
  • Min
  • Max
  • Count Distinct


Use cases

This action can be used for adding smoothed trendlines to charts.


Action settings

SettingDescription
New columnEnter the name of the column that will contain the aggregated values.
Target columnSelect the name of the column containing the values to be aggregated.
Aggregation modeSelect the aggregation method to be used on the values in the Target column. Options: Average, Sum, Min, Max, or Count Distinct.
Window size*Enter the number of consecutive rows to be included in the calculation.
Offset toSelect whether the calculated values in the New column will align with the top ("start") of the window, or the bottom ("end"). Options: Window start or Window end.
In groupsCheck this "on" and select one or more columns to group the aggregated results in.

* Setting can be specified using a parameter.


Remarks

The Window size determines how many rows' values are included within each calculation. A Window size of "4" includes 4 consecutive rows. The Offset to selection determines whether the output value aligns with the top/start or bottom/end of the current window.

If there aren't enough rows within the dataset or a group (if grouping is used) the Window size will be set to the number of available rows and a single calculation will be generated for that window.


Examples



See also

transformations/slidingaggregation.txt · Last modified: 2024/06/12 21:55 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki