Collapse

Syntax

Collapse(Input: ITimeSeries,
         Method: MsCollapseType,
         TargetFrequency: MsFrequency,
         MissingData: MissingDataMethod,
         NumberOfPoints: Integer,
         SpecifiedValue: Double,
         AdditionalSeries: ITimeSeries)

Parameters

Input. Input variable

Method. Aggregation method

TargetFrequency. Output frequency

MissingData. Missing data treatment method. Optional parameter. By default the parameter is set to MissingDataMethod.None - missing data is not treated

NumberOfPoints. Additional parameter for missing data treatment method. It can take only positive values. Optional parameter. By default the parameter is 1

SpecifiedValue. The value, with which missing data is substituted by the MissingDataMethod.SpecifiedValueValue method. Optional parameter. By default the parameter is 0

AdditionalSeries. The series used to substitute missing data by the MissingDataMethod.Pattern Pattern and MissingDataMethod.Overlay Overlay methods. Optional parameter. By default the parameter is set to Null.

Description

It aggregates the variable values.

Comments

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:

Example

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 can be used in model variable-based formulas of modeling container.

See also:

Functions Available in Expression Editor │ Aggregation │ IModelling.Collapse