IRubricatorInstance.CreateFiltrationMatrix

Fore Syntax

CreateFiltrationMatrix (Selections: IDimSelectionSet): IMatrixModel;

Fore.NET Syntax

CreateFiltrationMatrix (Selections: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet):
Prognoz.Platform.Interop.ForeSystem.IMatrixModel;

Parameters

Selections. Complex dictionary selection.

Description

The CreateFiltrationMatrix method creates a filtered data matrix.

Comments

This method enables the user to get information whether time series database contains data.

Fore Example

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 <> NullAnd (Attribute.Nullable = FalseThen
                Result.Add((Attribute.ValuesObject.Open(NullAs 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(NullAs 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.

Fore.NET Example

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 <> NullAnd (Attribute.Nullable = FalseThen
                Result.Add((Attribute.ValuesObject.Open(NullAs 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(NullAs 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:

IRubricatorInstance