Position: Integer;
Position: Integer;
The Position property determines position of the dimension in a group.
Executing the example requires that the repository contains the FC_DEP time series database.
Sub UserProc;
Var
Mb: IMetabase;
Rubricator: IMetabaseObject;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
Sels: IDimSelectionSet;
CubeExSet: ICubeExecuteSetup;
i: Integer;
DimSetup: ICubeExecuteDimSetup;
Exe: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
b: Boolean;
Begin
Mb := MetabaseClass.Active;
Rubricator := Mb.ItemById("FC_DEP").Bind;
Cub := Rubricator.Open(Null) As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Sels := Dest.CreateDimSelectionSet;
CubeExSet := Sels As ICubeExecuteSetup;
For i := 0 To CubeExSet.Count - 1 Do
DimSetup := CubeExSet.Item(i);
Debug.WriteLine("Identifier: " + DimSetup.Id);
Debug.WriteLine("Group index: " + DimSetup.GroupIndex.ToString);
Debug.WriteLine("Position in group: " + DimSetup.Position.ToString);
b := DimSetup.Options.Required = CubeDimensionExecuteOptions.Required;
Debug.WriteLine(b ? "Mandatory dimension" : "Non-mandatory dimension");
b := DimSetup.Predefined = Null;
Debug.WriteLine(b ? "No predetermined options" : "Predetermined options are available");
Select Case DimSetup.Tag
Case CubeDimensionTag.Calendar: Debug.WriteLine("Calendar dimension");
Case CubeDimensionTag.Facts: Debug.WriteLine("Factor dimension");
Case CubeDimensionTag.None: Debug.WriteLine("Dimension type is not determined");
Case CubeDimensionTag.Units: Debug.WriteLine("Units");
End Select;
DimSetup.Selection.SelectAll;
Debug.WriteLine("------");
End For;
Exe := Dest.CreateExecutor;
Exe.PrepareExecute(Sels);
Exe.PerformExecute;
Mat := Exe.Matrix;
End Sub UserProc;
After executing the example the console window displays group index, position in the group, and other parameters of the dimensions included into default layout of the time series database. The time series database is calculated with the given parameters, and the calculation results are saved to the Mat variable.
Executing the example requires that the repository contains the FC_DEP time series database.
Imports System.Diagnostics;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Matrix;
Public Sub UserProc(Params: StartParams);
Var
Mb: IMetabase;
Rubricator: IMetabaseObject;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
Sels: IDimSelectionSet;
CubeExSet: ICubeExecuteSetup;
i: Integer;
DimSetup: ICubeExecuteDimSetup;
Exe: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
b: Boolean;
Begin
Mb := Params.Metabase;
Rubricator := Mb.ItemById["FC_DEP"].Bind();
Cub := Rubricator.Open(Null) As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Sels := Dest.CreateDimSelectionSet();
CubeExSet := Sels As ICubeExecuteSetup;
For i := 0 To CubeExSet.Count - 1 Do
DimSetup := CubeExSet.Item[i];
Debug.WriteLine("Identifier: " + DimSetup.Id);
Debug.WriteLine("Index of a group: " + DimSetup.GroupIndex.ToString());
Debug.WriteLine("Position in a group: " + DimSetup.Position.ToString());
b := DimSetup.Options.cubdimoptRequired = CubeDimensionExecuteOptions.cubdimoptRequired;
Debug.WriteLine(b ? "Mandatory dimension" : "Non-mandatory dimension");
b := DimSetup.Predefined = Null;
Debug.WriteLine(b ? "No predetermined options" : "Predetermined options are available");
Select Case DimSetup.Tag
Case CubeDimensionTag.cubdimtagCalendar: Debug.WriteLine("Calendar dimension");
Case CubeDimensionTag.cubdimtagFacts: Debug.WriteLine("Factor dimension");
Case CubeDimensionTag.cubdimtagNone: Debug.WriteLine("Dimension type is not determined");
Case CubeDimensionTag.cubdimtagUnits: Debug.WriteLine("Units");
End Select;
DimSetup.Selection.SelectAll();
Debug.WriteLine("------");
End For;
Exe := Dest.CreateExecutor();
Exe.PrepareExecute(Sels);
Exe.PerformExecute(False);
Mat := Exe.Matrix;
End Sub UserProc;
After executing the example the console window displays group index, position in the group, and other parameters of the dimensions included into default layout of the time series database. The time series database is calculated with the given parameters, and the calculation results are saved to the Mat variable.
See also: