IVariableStub.CalendarDimIndex

Fore Syntax

CalendarDimIndex: Integer;

Fore.NET Syntax

CalendarDimIndex: Integer;

Description

The CalendarDimIndex property returns calendar dimension index in a data source.

Comments

If the property returns -1, calendar dimension is missing in the data source.

Fore Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing a model with the MODEL_LINEARREGR identifier. This model must use cube as a data source.

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

Sub UserProc;
Var
    mb: Imetabase;
    MsKey: Integer;
    Model: IMsModel;
    Outputs: IMsFormulaTransformVariables;
    Stub: IVariableStub;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modeling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get model
    Model := mb.ItemByIdNamespace("MODEL_LINEARREGR", MsKey).Bind As IMsModel;
    // Get output variables
    Outputs := Model.Transform.Outputs;
    // Get data source of the first output variable
    Stub := Outputs.Item(0).Stub;
    // Display calendar dimension index in the obtained source in the console window
    Debug.WriteLine("Calendar dimension index in data source '" +
        Stub.Id + "': " + Stub.CalendarDimIndex.ToString);
End Sub UserProc;

After executing the example the console window displays calendar dimension index for output variable data source.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: Imetabase;
    MsKey: uinteger;
    Model: IMsModel;
    Outputs: IMsFormulaTransformVariables;
    Stub: IVariableStub;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get modeling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get model
    Model := mb.ItemByIdNamespace["MODEL_LINEARREGR", MsKey].Bind() As IMsModel;
    // Get output variables
    Outputs := Model.Transform.Outputs;
    // Get data source of the first output variable
    Stub := Outputs.Item[0].Stub;
    // Display calendar dimension index in the obtained source in the console window
    System.Diagnostics.Debug.WriteLine("Calendar dimension index in data source '" +
        Stub.Id + "': " + Stub.CalendarDimIndex.ToString());
End Sub;

See also:

IVariableStub