SelectionIndex: IStandardDimIndex;
SelectionIndex: Prognoz.Platform.Interop.Dimensions.IStandardDimIndex;
The SelectionIndex property returns index that is used to generate selection.
The index is used to save and restore selection by dimension based on dictionary.
Executing the example requires that repository contains table dictionary with the SELECTION_INDEX identifier. This dictionary must be used as dimension in time series database.
Add links to the Dimensions, Metabase system assemblies.
Sub UseProc;
Var
mb: IMetabase;
Dim: IStandardDimension;
Indexes: IStandardDimIndexes;
Index: IStandardDimIndex;
Attr: IDimAttribute;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get dictionary
Dim := mb.ItemById("SELECTION_INDEX").Bind As IStandardDimension;
// Get dictionary indexes
Indexes := Dim.Indexes;
// Get index of the dictionary used to form selection
Index := Indexes.SelectionIndex;
// Display information about index to the console
If Index <> Null Then
Debug.WriteLine("Index name: " + Index.Name);
Debug.WriteLine("Attributes in the index:");
For Each Attr In Index.Attributes Do
Debug.WriteLine(" " + Attr.Name);
End For;
End If;
End Sub UseProc;
After executing the example the console displays information about index used for selection creating if it is present in the dictionary.
The requirements and result of the Fore.NET example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Dim: IStandardDimension;
Indexes: IStandardDimIndexes;
Index: IStandardDimIndex;
Attr: IDimAttribute;
Begin
// Get current repository
mb := Params.Metabase;
// Get dictionary
Dim := mb.ItemById["SELECTION_INDEX"].Bind() As IStandardDimension;
// Get dictionary indexes
Indexes := Dim.Indexes;
// Get index of the dictionary used to form selection
Index := Indexes.SelectionIndex;
// Display information about index to the console
If Index <> Null Then
System.Diagnostics.Debug.WriteLine("Index name: " + Index.Name);
System.Diagnostics.Debug.WriteLine("Attributes in the index:");
For Each Attr In Index.Attributes Do
System.Diagnostics.Debug.WriteLine(" " + Attr.Name);
End For;
End If;
End Sub;
See also: