Collapse(Input: ITimeSeries,
Method: MsCollapseType,
TargetFrequency: MsFrequency,
MissingData: MissingDataMethod,
NumberOfPoints: Integer,
SpecifiedValue: Double,
AdditionalSeries: ITimeSeries)
Input. Input variable.
Method. Aggregation method.
TargetFrequency. Output frequency.
MissingData. Missing data treatment method. Optional parameter. The parameter is set to MissingDataMethod.None - missing data is not treated by default.
NumberOfPoints. Additional parameter for missing data treatment method. It can take only positive values. Optional parameter. The parameter is set to 1 by default.
SpecifiedValue. The value, with which missing data is substituted by the MissingDataMethod.SpecifiedValueValue method. Optional parameter. The parameter is set to 0 by default.
AdditionalSeries. The series that is used to substitute missing data with the methods: MissingDataMethod.Pattern "Pattern" and MissingDataMethod.Overlay "Overlay". Optional parameter. By default the parameter is set to Null.
It aggregates the variable values.
This function aggregates data from the lower level to the higher level; it is used to calculate problems that require data aggregation. For example, data calculated by months needs to be summed for quarterly frequency.
On data aggregation, the following calendar frequency settings are taken into account: start period offset relative to its start/end.
Example of data aggregation from daily to weekly frequency
The NumberOfPoints parameter is used for the following methods of missing data treatment:
MissingDataMethod.NPointsAverage. N-Point Average. Parameter determines number of neighbor points.
PreviousGrowthRate, SucceedingGrowthRate. Previous Growth Rate, Succeeding Growth Rate. The parameter determines the number of periods.
Formula | Result | Application |
= Collapse({Brazil|BCA}, MsCollapseType.Total, MsFrequency.Annual, MissingDataMethod.NPointsAverage, 4) | Data is aggregated for the Brazil|BCA time series for annual frequency by summing method with missing data treatment by the N-Point Average method where N = 4. | It can be used in formulas of calculated series of time series database and in formulas of attribute-based models of modeling container. |
= Collapse(X1, MsCollapseType.Average, MsFrequency.Annual, MissingDataMethod.LinTrend) | For the X1 factor data aggregation for annual frequency using average value calculation method with the Linear Trend missing data treatment method. | It is used in model variable-based formulas of modeling container. |
See also:
Functions Available in Expression Editor │ Aggregation │ IModelling.Collapse