IMsCalculationChainEntry.InheritModelPeriod

Syntax

InheritModelPeriod: Boolean;

Description

The InheritModelPeriod property determines whether the chain element inherits period and calculation frequency of the parent element.

Comments

Available values:

Example

Executing the example requires that the repository contains a modeling container with the MODELING_CONTAINER identifier. This container contains a metamodel with the META_MODEL identifier and a model with the MODEL identifier.

Add links to the Dimensions, Metabase, Ms system assemblies.

Sub UserInherit;
Var
    Metabase: IMetabase;
    ModelspaceDescr: IMetabaseObjectDescriptor;
    MetaModel: IMsMetaModel;
    CalculationChain, FolderCont: IMsCalculationChainEntries;
    Folder: IMsCalculationChainFolder;
    Period: IMsModelPeriod;
    Model: IMsModel;
    CalcModel: IMsCalculationChainModel;
Begin
    Metabase := MetabaseClass.Active;
    // Get modeling container
    ModelspaceDescr := Metabase.ItemById("MODELING_CONTAINER");
    // Get metamodel
    MetaModel := Metabase.ItemByIdNamespace("META_MODEL", ModelspaceDescr.Key).Edit As IMsMetaModel;
    // Get calculation chain and create a folder in it
    CalculationChain := MetaModel.CalculationChain;
    Folder := CalculationChain.AddFolder("Initial data");
    // Set parameters of folder calculation
    Folder.Level := DimCalendarLevel.Year;
    Period := Folder.Period;
    Period.ForecastEndDate := DateTime.ComposeDay(20191231);
    Period.ForecastStartDate := DateTime.ComposeDay(201011);
    Period.IdentificationEndDate := DateTime.ComposeDay(20091231);
    Period.IdentificationStartDate := DateTime.ComposeDay(200011);
    FolderCont := Folder.Contents;
    // Get model
    Model := Metabase.ItemByIdNamespace("MODEL", ModelspaceDescr.Key).Bind As IMsModel;
    // Add a model to folder
    CalcModel := FolderCont.AddModel(Model);
    // Specify that model inherits period and calculation frequency from folder
    CalcModel.InheritModelPeriod := True;
    // Save changes
    (MetaModel As IMetabaseObject).Save;
End Sub UserInherit;

After executing the example, the folder that contains a metamodel is added to the metamodel chain. This folder is regarded as a group. A period and calculation frequency are set for it. The model that is located in the folder inherits the period and calculation frequency of the folder.

See also:

IMsCalculationChainEntry