SelectionIndex: IDimIndexInstance;
SelectionIndex: Prognoz.Platform.Interop.Dimensions.IDimIndexInstance;
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 the repository contains MDM dictionary with the USE_IN_SELECTION identifier. This dictionary must be out of MDM repository and must be used only as dimension in time series database.
Add links to the Dimensions, Metabase system assemblies.
Sub UseProc;
Var
mb: IMetabase;
DimInst: IDimInstance;
Indexes: IDimIndexesInstance;
Index: IDimIndexInstance;
Attr: IDimAttribute;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get dictionary
DimInst := mb.ItemById("USE_IN_SELECTION").Open(Null) As IDimInstance;
// Get dictionary indexes
Indexes := DimInst.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.Index.Name);
Debug.WriteLine(Index.CaseSensitive ? "Index is case-sensitive" : "Index is not case-sensitive");
Debug.WriteLine("Attributes in the index:");
For Each Attr In Index.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;
DimInst: IDimInstance;
Indexes: IDimIndexesInstance;
Index: IDimIndexInstance;
Attr: IDimAttribute;
Begin
// Get current repository
mb := Params.Metabase;
// Get dictionary
DimInst := mb.ItemById["USE_IN_SELECTION"].Open(Null) As IDimInstance;
// Get dictionary indexes
Indexes := DimInst.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.Index.Name);
System.Diagnostics.Debug.WriteLine(Index.CaseSensitive ? "Index is case-sensitive" : "index is not case-sensitive");
System.Diagnostics.Debug.WriteLine("Attributes in the index:");
For Each Attr In Index.Index.Attributes Do
System.Diagnostics.Debug.WriteLine(" " + Attr.Name);
End For;
End If;
End Sub;
See also: