VariableMatrix(Stub: IVariableStub): IMatrixDataSource;
Stub. Abstract data source.
The VariableMatrix property restores access to the specified data source.
For validation rules the VariableMatrix property always returns Null.
This example displays a custom method used for series calculation mode. Executing the example requires a modeling variable with the 13418 key.
Add links to the Metabase, Ms, Transform, Matrix, Cubes system assemblies.
Public Function CopyData: Variant;
Var
pContext: ITsCalculationContext;
i: Integer;
pSeries: ITimeSeries;
mb: IMetabase;
VarStub: IVariableStub;
MatrixDS: IMatrixDataSource;
Matr: IMatrix;
MatrIter: IMatrixIterator;
Begin
pContext := TsCalculation.Current;
pSeries := pContext.CreateTimeSeries;
If pContext.CalculationType = TsCalculationType.Series Then
mb := MetabaseClass.Active;
VarStub := mb.Item(13418).Bind As IVariableStub;
MatrixDS := pContext.VariableMatrix(VarStub);
Matr := MatrixDS.Execute(Null);
MatrIter := Matr.CreateIterator;
MatrIter.Move(IteratorDirection.First);
For i := pSeries.StartIndex To pSeries.EndIndex Do
pSeries.Item(i) := MatrIter.Value;
MatrIter.Move(IteratorDirection.Next);
End For;
Return pSeries;
End If;
End Function CopyData;
The method copies data from the variable with the 13418 key.
See also: