CreateFiltrationMatrix (Selections: IDimSelectionSet): 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.
See also: