CalendarDimIndex: Integer;
The CalendarDimIndex property returns calendar dimension index in a data source.
If the property returns -1, calendar dimension is missing in the data source.
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.
See also: