ILaner.IdentByFact

Fore Syntax

IdentByFact: Boolean;

Fore.NET Syntax

IdentByFact: Boolean;

Description

The IdentByFact property determines whether the data is taken for sample period by the Fact scenario.

Comments

The property is relevant for working with series from time series database in modeling and forecasting.

Available values:

Fore Example

Executing the example requires a form with the LanerBox component and the UiErAnalyzer component with the UiErAnalyzer1 identifier, that is a data source for LanerBox. Workbook of the time series database must be loaded to UiErAnalyzer1. Repository must include a modeling container with the MS identifier containing a modeling problem with the FILLMODEL identifier. This task must contain an internal metamodel containing an internal time series database and a model. Also, the modeling container must include a scenario with the 43276 key. The scenario is used to calculate the FILLMODEL task.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    wb: IMetabaseObject;
    MsObj: IMetabaseObjectDescriptor;
    Meta: IMsMetaModel;
    MetaVisual: IMsMetaModelVisualController;
    SimpleModel: IMsModel;
    ScArr: Array Of Integer;
    pr: IMsProblem;
    Period: IMsModelPeriod;
    i: Integer;
    ChainEn: IMsCalculationChainEntries;
    Laner: ILaner;
Begin
    // Get workbook
    wb := UiErAnalyzer1.Object.Edit;
    mb := MetabaseClass.Active;
    // Get modeling container
    MsObj := mb.ItemById("MS");
    // Get modeling problem
    pr := mb.ItemByIdNamespace("FILLMODEL", MsObj.Key).Bind As IMsProblem;
    // Get metamodel
    Meta := pr.MetaModel;
    MetaVisual := Meta.VisualController;
    // Get model
    ChainEn := Meta.CalculationChain;
    For i := 0 To ChainEn.Count - 1 Do
        If ChainEn.Item(i).Type = MsCalculationChainEntryType.Model Then
            SimpleModel := (ChainEn.Item(i) As IMsCalculationChainModel).Model;
        End If;
    End For;
    // Create an array of scenario keys
    ScArr := New Integer[2];
    ScArr[0] := -1;
    ScArr[1] := 43276;
    Period := SimpleModel.Period;
    // Fill in the workbook by data from the model
    MetaVisual.FillWithModel(SimpleModel, ScArr, Period, Period, pr, wb);
    wb.Save;
    // Open the workbook
    Laner := (wb As IEaxAnalyzer).Laner;
    Laner.BeginUpdate;
    UiErAnalyzer1.Object := wb;
    UiErAnalyzer1.Active := True;
    // Sample data is taken by the Fact scenario 
    Laner.IdentByFact := True;
    Laner.Update;
    Laner.EndUpdate;
End Sub UserProc;

After executing the example the workbook filled in by the data from the internal model is opened.

After executing the example UiErAnalayzer1 contains the opened workbook filled in by the data from the internal model by several scenarios. The data for calculation for sample period are taken by the Fact scenario.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Ms;

Public Sub UserProc();
Var
    mb: IMetabase;
    wb: IMetabaseObject;
    MsObj: IMetabaseObjectDescriptor;
    Meta: IMsMetaModel;
    MetaVisual: IMsMetaModelVisualController;
    SimpleModel: IMsModel;
    ScArr: Array Of Integer;
    pr: IMsProblem;
    Period: IMsModelPeriod;
    i: Integer;
    ChainEn: IMsCalculationChainEntries;
    Laner: ILaner;
Begin
    // Get workbook
    wb := uiErAnalyzerNet1.Object.Edit();
    mb := Self.Metabase;
    // Get modeling container
    MsObj := mb.ItemById["MS"];
    // Get modeling problem
    pr := mb.ItemByIdNamespace["FILLMODEL", MsObj.Key].Bind() As IMsProblem;
    // Get metamodel
    Meta := pr.MetaModel;
    MetaVisual := Meta.VisualController;
    // Get model
    ChainEn := Meta.CalculationChain;
    For i := 0 To ChainEn.Count - 1 Do
        If ChainEn.Item[i].Type = MsCalculationChainEntryType.mccetModel Then
            SimpleModel := (ChainEn.Item[i] As IMsCalculationChainModel).Model;
        End If;
    End For;
    // Create an array of scenario keys
    ScArr := New Integer[2];
    ScArr[0] := -1;
    ScArr[1] := 43276;
    Period := SimpleModel.Period;
    // Fill in the workbook by data from the model
    MetaVisual.FillWithModel(SimpleModel, ScArr, Period, Period, pr, wb);
    // Open the workbook
    Laner := (wb As IEaxAnalyzer).Laner;
    Laner.BeginUpdate();
    uiErAnalyzerNet1.Object := wb;
    uiErAnalyzerNet1.Active := True;
    // Sample data are taken by the Fact scenario
    Laner.IdentByFact := True;
    Laner.Update();
    Laner.EndUpdate();
End Sub UserProc;

See also:

ILaner