TimeDependencyEnabled: Boolean;
The TimeDependencyEnabled property determines whether time dependency can be set for formulas.
This property returns True if the consumer contains a calendar dimension, otherwise it returns False.
Executing the example requires that the repository contains a database with the DB identifier and two standard cubes with the CUBE_INPUT and CUBE_OUTPUT identifiers. The cube with the CUBE_OUTPUT identifier must contain a calendar dimension.
Add links to the Cubes, Db and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
MDCalc: IMDCalculation;
Cube: ICubeModel;
Source: IMDCalculationSource;
Destination: IMDCalculationDestination;
FormulasTable: IMDCalculationFormulasTable;
TableForFormulas: ITable;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Create an object and set its parameters
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_MDCALCULATION;
CrInfo.Id := MB.GenerateId("MDCALC");
CrInfo.Name := "Multidimensional calculation on server";
CrInfo.Parent := Null;
// Get the Multidimensional Calculation on Server object
MObj := MB.CreateObject(CrInfo).Edit;
MDCalc := MObj As IMDCalculation;
// Add a database
MDCalc.Database := MB.ItemById("DB").Bind As IDatabase;
// Specify source cube
Cube := MB.ItemById("CUBE_INPUT").Bind As ICubeModel;
Source := MDCalc.Sources.AddCube(Cube);
// Specify destination cube
Destination := MDCalc.Destination;
Destination.SetCube(MB.ItemById("CUBE_OUTPUT").Bind As ICubeModel);
// Create a new formulas table
If MDCalc.TimeDependencyEnabled Then
MDCalc.TimeDependent := True;
End If;
FormulasTable := MDCalc.FormulasTable;
TableForFormulas := FormulasTable.Create;
FormulasTable.Attach(TableForFormulas);
// Save Multidimensional Calculation on Server
MObj.Save;
End Sub UserProc;
After executing the example the Multidimensional Calculation on DB Server object is created in the repository root, for which a source cube and a destination cube are set, a new formulas table is created, formula actual period can be enabled.
See also:
IMDCalculation | IMDCalculation.TimeDependent | IMDCalculationInstance.TimeDependent