MultipleFactors: Boolean;
The MultipleFactors property determines whether to save or extract data using several factors. True - execute operations with data of several factors, False - with data of one factor.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. This database must contain a unique factor attribute with the COUNTRIES identifier that refers to a dictionary.
Sub Main;
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
FactorExec: IRubricatorFactorExecutor;
FactorIO: IRubricatorFactorIO;
FactsLookup: IRubricatorFactsLookup;
MetaDLookup: IMetaDictionaryLookup;
Key: Array Of Integer;
i: Integer;
Cond: IOrmCondition;
Exec: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
Ite: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
RubDesc := MB.ItemById("OBJ_RUBRICATOR");
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
Cub := RubrIn As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Exec := Dest.CreateExecutor;
FactorExec := Exec As IRubricatorFactorExecutor;
FactsLookup := RubrIn.CreateFactsLookup;
MetaDLookup := FactsLookup.Lookup;
Cond := MetaDLookup.Where.Add;
Cond.AttributeName := "COUNTRIES";
Cond.Value := 512;
i := FactsLookup.LookupFactors.Length;
Key := New Integer[i];
Key := FactsLookup.LookupFactors;
FactorExec.SetFactorKeys(Key);
FactorIO := FactorExec As IRubricatorFactorIO;
FactorIO.MultipleFactors := True;
FactorIO.ValueKind := MetaAttributeKind.Value;
FactorIO.ValueId := "VL";
Exec := FactorExec.AsCubeExecutor;
Exec.PrepareExecute(Null);
Exec.PerformExecute;
Mat := Exec.Matrix;
Ite := Mat.CreateIterator;
Ite.Move(IteratorDirection.First);
While Ite.Valid Do
Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.Next);
End While;
End Sub Main;
After executing the example data of the factors that correspond to the following condition is displayed in the console window: value of the COUNTRIES attribute equals to 512.
See also: