References: String;
The References property determines the list of units/forms containing the custom functions that are used to create an expression.
Identifiers of units/forms in the list are separated by the ";" symbol. All the functions contained in these units and used to create an expression must be declared with the Public modifier.
Executing the example requires a calculated cube with the Virt_Cube identifier and Module_1, Module_2 units containing custom functions MyFunc, MyFunc1. These functions calculate values for the specified cube coordinates.
Sub Main;
Var
MB: IMetabase;
CCI: ICalculatedCubeInstance;
Coo: ICalculatedCubeInstanceCoord;
Formulas: ICalculatedCubeFormulas;
Formula: ICalculatedCubeFormula;
Expr: IExpression;
i: Integer;
Begin
Mb := MetabaseClass.Active;
CCI := Mb.ItemById("Virt_Cube").Open(Null) As ICalculatedCubeInstance;
Coo := CCI.CreateCoord;
For i := 0 To Coo.MatrixCoord.Count - 1 Do
Coo.MatrixCoord.Item(i) := 0;
End For;
Formulas := CCI.Formula(Coo);
Formula := Formulas.Item(0);
Expr := Formula.Expression;
Expr.References := "Module_1;Module_2";
Expr.AsString := "MyFunc-MyFunc1";
Formulas.Save;
CCI.SaveFormulas;
End Sub Main;
After executing the example one formula will be added in the calculated cube by the specified coordinate. In the formula expression the custom functions contained in the Module_1 and Module_2 units will be used.
See also: