SetCompoundFactorKeys(Value: Array);
Value. The array of composite keys of time series.
The SetCompoundFactorKeys method determines the composite keys of time series that must be calculated.
The IRubricatorFactorExecutor.SetFactorKeys method sets the keys that must be calculated.
Executing the example requires that the repository contains a time series database with the FC identifier. Add links to the Metabase, Cubes, Matrix, Rds system assemblies.
Sub uProc;
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
FactorExec: IRubricatorFactorExecutor;
FactsLookup: IRubricatorFactsLookup;
Key: Array Of Variant;
i: Integer;
Exec: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
Ite: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
RubDesc := MB.ItemById("FC");
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
Cub := RubrIn As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Exec := Dest.CreateExecutor;
FactorExec := Exec As IRubricatorFactorExecutor;
FactsLookup := RubrIn.CreateFactsLookup;
i := FactsLookup.LookupFactorsC.Length;
Key := New Variant[i];
Key := FactsLookup.LookupFactorsC;
FactorExec.SetCompoundFactorKeys(Key);
FactorExec.ValueKind := MetaAttributeKind.Value;
FactorExec.ValueId := "VL";
FactorExec.UseDwarf := True;
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 uProc;
After executing the example the console window displays the time series values with composite key.
See also: