IMsMethod.PeriodAlignment

Syntax

PeriodAlignment: MsMethodPeriodAlignment;

Description

The PeriodAlignment property returns type of model calculation relative to period.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. This container must contain a model with the M_COLLAPSE identifier that is calculated by the method of pointwise collapse.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Model: IMsModel;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Collapse: IMsPointwiseCollapseTransform;

Formula: IMsFormula;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("M_COLLAPSE", MB.ItemById("MODEL_SPACE").Key).Bind;

Model := MObj As IMsModel;

VarTrans := Model.Transform.Outputs.Item(0);

Tree := VarTrans.SlicesTree(VarTrans);

Slice := Tree.CreateSlice(1);

Selector := Model.Transform.CreateSelector;

Selector.Slice := Slice;

Formula := Model.Transform.Transform(Selector);

Collapse := Formula.Method As IMsPointwiseCollapseTransform;

If Collapse.PeriodAlignment = MsMethodPeriodAlignment.Beginning

Then Debug.WriteLine(Is counted to the beginning of the period);

Else Debug.WriteLine(Is counted to the end of the period);

End If;

End Sub Main;

After executing the example, the information about calculation type of model method comparatively to the period is displayed in the console window.

See also:

IMsMethod