NamingAttributes(Dimension: IDimensionModel): IDimAttributesList;
Dimension. The dimensions, for which formula element display settings are determined.
The NamingAttributes property determines the list of attributes, which values will be used to display dimension elements in formula.
Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. A calculation block is created in the algorithm, for which at least one formula is created.
Add links to the Algo, Cubes, Dimensions, Metabase, and Ms system assemblies. Also, add links to the assemblies that are required to work with calculation algorithms.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Algo, CalcBlock: ICalcObject;
CalcAlgo: ICalcAlgorithm;
Block: ICalcBlock;
Model: IMsModel;
Transform: IMsFormulaTransform;
InputCube: IVariableStub;
Dim: IDimensionModel;
Attrs: IDimAttributesList;
i, c: Integer;
Begin
MB := MetabaseClass.Active;
// Get calculation algorithm
MObj := MB.ItemById("ALGORITHM");
Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
CalcAlgo := Algo As ICalcAlgorithm;
// Get calculation block
CalcBlock := CalcAlgo.Items.Item(0);
Block := CalcBlock As ICalcBlock;
// Calculation block model
Model := (Block.Folder.Contents.Item(0) As IMsCalculationChainModel).EditModel;
Transform := Model.Transform;
// Source cube
InputCube := Transform.Inputs.Item(0).VariableStub;
// Set up displaying of source cube dimension elements in calculation block formula
c := InputCube.DimensionCount;
For i := 0 To c - 1 Do
Dim := InputCube.Dimension(i);
Attrs := New DimAttributesList.Create(Dim, Dim.Attributes.Id.Id);
Transform.NamingAttributes(Dim) := Attrs;
End For;
// Save changes in calculation block
Block.SaveObject;
End Sub UserProc;
After executing the example source cube dimension element display settings are changed in the calculation block formula. The formula will display dimension element identifiers as names.
See also: