Add: Integer;
The Add method adds a new element to the dictionary and returns number of row where it can be placed.
Element is added to the end of the list. Values of all attributes are not set, use the AttributeValue property to set values.
Executing the example requires that the repository contains a standard cube with the STD_CUBE identifier.
Add links to the Cubes, Dimensions, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Cube: IStandardCube;
CustDim: ICustomDimension;
DimElems: ICustomDimElements;
i: Integer;
Begin
MB := MetabaseClass.Active;
// Get standard cube
MObj := MB.ItemById("CUBE").Edit;
Cube := MObj As IStandardCube;
// Get cube facts dimension structure
CustDim := Cube.FactDimension.Dimension As ICustomDimension;
// Get collection of dimension elements
DimElems := CustDim.Elements;
// Add new element
i := DimElems.Add;
// Determine attribute values for new element
DimElems.AttributeValue(i, 0) := i;
DimElems.AttributeValue(i, 1) := "Element " + i.ToString;
DimElems.AttributeValue(i, 2) := i;
MObj.Save;
End Sub UserProc;
After executing the example a new element is created in the fact dimension of the cube with the CUBE identifier.
See also: