ReverseFactKey: Variant;
The ReverseFactKey property determines key of the cube fact, which value is calculated by the ReverseFormula formula.
The fact with the ReverseFactKey key must be linked to any cube data source.
Executing the example requires a standard cube with the STD_CUBE identifier. There are at least three elements in the cube fact dimension.
Sub UserProc;
Var
MB: IMetabase;
StdCube: IStandardCube;
Dest: IStandardCubeDestination;
StdDataset: IStandardCubeDataset;
Dataset: IDatasetModel;
Field: IDatasetModelField;
FactBind: IStandardCubeFactBinding;
v: Variant;
Begin
MB := MetabaseClass.Active;
StdCube := MB.ItemById("STD_CUBE").Edit As IStandardCube;
Dest := StdCube.Destinations.Item(0);
StdDataset := Dest.Datasets.Item(0);
Dataset := StdDataset.Dataset;
Field := Dataset.Fields.Item(0);
FactBind := Dest.FactBindings(StdDataset).Binding(1);
FactBind.Formula.AsString := (Dataset As IMetabaseObject).Id + "." + Field.Id;
Field := Dataset.Fields.Item(1);
FactBind := Dest.FactBindings(StdDataset).Binding(2);
FactBind.Formula.AsString := (Dataset As IMetabaseObject).Id + "." + Field.Id;
v := FactBind.FactKey;
FactBind := Dest.CalcBindings.Binding(3);
FactBind.Formula.AsString := "@[1]*3";
FactBind.ReverseFactKey := v;
FactBind.ReverseFormula.AsString := "((VALUE + 1) * 4 - 2) / 2 ";
(StdCube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example binding for the first three elements of the cube fact dimension is set up. The first and second cube facts are linked to two fields of the data source, the third one is determined as calculated, its value is calculated on the basis of the first fact, and also value of the second fact is changed by the specified formula.
See also: