CreateFiltrationMatrix (Selections: IDimSelectionSet): IMatrixModel;
CreateFiltrationMatrix (Selections: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet):
Prognoz.Platform.Interop.ForeSystem.IMatrixModel;
Selections. Complex dictionary selection.
The CreateFiltrationMatrix method creates a filtered data matrix.
This method enables the user to get information whether time series database contains data.
Executing the example requires that the repository contains a time series database with the TSDB identifier.
Add links to the Cubes, Dimensions, Metabase, Rds system assemblies.
Function CreateRubricatorSelectionSet(facts: IMetaDictionary): IDimSelectionSet;
Var
Result: IDimSelectionSet;
Factory: IDimSelectionSetFactory;
Attribute: IMetaAttribute;
Begin
Factory := New DimSelectionSetFactory.Create As IDImSelectionSetFactory;
Result := Factory.CreateDimSelectionSet;
For Each Attribute In Facts.Attributes Do
If (Attribute.ValuesObject <> Null) And (Attribute.Nullable = False) Then
Result.Add((Attribute.ValuesObject.Open(Null) As IDimInstance));
Result.Item(Result.Count - 1).SelectAll;
End If;
End For;
Return Result;
End Function CreateRubricatorSelectionSet;
Sub UserProc;
Var
Metabase: IMetabase;
Object: IMetabaseObjectDescriptor;
Rubricator: IRubricatorInstance;
Selections: IDimSelectionSet;
FiltMat: IMatrix;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get time series database
Object := Metabase.ItemById("TSDB");
Rubricator := Object.Open(Null) As IRubricatorInstance;
// Get filtered data matrix
Selections := CreateRubricatorSelectionSet(Rubricator.Rubricator.Facts);
FiltMat := Rubricator.CreateFiltrationMatrix(Selections) As IMatrix;
// Display the number of matrix dimensions in the console window
Debug.WriteLine("Number of matrix dimensions: " + FiltMat.DimensionCount.ToString);
End Sub UserProc;
After executing the example the console window displays the number of dimensions included into filtered data matrix.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Rds;
…
Shared Function CreateRubricatorSelectionSet(facts: IMetaDictionary): IDimSelectionSet;
Var
Result: IDimSelectionSet;
Factory: DimSelectionSetFactory = New DimSelectionSetFactory();
Attribute: IMetaAttribute;
Begin
Result := Factory.CreateDimSelectionSet();
For Each Attribute In Facts.Attributes Do
If (Attribute.ValuesObject <> Null) And (Attribute.Nullable = False) Then
Result.Add((Attribute.ValuesObject.Open(Null) As IDimInstance));
Result.Item[Result.Count - 1].SelectAll();
End If;
End For;
Return Result;
End Function CreateRubricatorSelectionSet;
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase;
Object: IMetabaseObjectDescriptor;
Rubricator: IRubricatorInstance;
Selections: IDimSelectionSet;
FiltMat: IMatrix;
Begin
// Get repository
Metabase := Params.Metabase;
// Get time series database
Object := Metabase.ItemById["TSDB"];
Rubricator := Object.Open(Null) As IRubricatorInstance;
// Get filtered data matrix
Selections := CreateRubricatorSelectionSet(Rubricator.Rubricator.Facts);
FiltMat := Rubricator.CreateFiltrationMatrix(Selections) As IMatrix;
// Display the number of matrix dimensions in the console window
System.Diagnostics.Debug.WriteLine("Number of matrix dimensions: " + FiltMat.DimensionCount.ToString());
End Sub;
See also: