ParametrizedDimensions: IMsParametrizedDimensions;
ParametrizedDimensions: Prognoz.Platform.Interop.Ms.IMsParametrizedDimensions;
The ParametrizedDimensions property returns collection of dimensions of the slice of the variable that can be parameterized.
Numeration of the collection is continuous and starts with zero.
Executing the example requires that the repository contains a time series database with the FC_PARAM identifier. This database contains the COUNTRY attribute that refers to the dictionary. Modeling container of the database contains a metamodel with the META_MODEL identifier and a model with the MODEL identifier. A parameter, that refers to the same dictionary as the COUNTRY attribute, is set for the metamodel.
Add links to the Metabase, Cubes, Ms, Dimensions, Rds system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Catalog: IRubricator;
Transforms: IMetabaseObjectDescriptor;
MetaModel: IMsMetaModel;
Model: IMsModel;
Transform: IMsFormulaTransform;
Input: IMsFormulaTransformVariable;
Slice: IMsFormulaTransformSlice;
Sel: IDimSelectionSet;
Atts: IMetaAttributes;
Dict: IMetabaseObjectDescriptor;
dimInst: IDimInstance;
dimSel: IDimSelection;
Params: IMsModelParams;
paramDim: IMsParametrizedDimensions;
paramD: IMsParametrizedDimension;
pr: IMsModelParam;
Begin
mb := MetabaseClass.Active;
Catalog := mb.ItemById("FC_PARAM").Bind As IRubricator;
Transforms := Catalog.ModelSpace;
MetaModel := mb.ItemByIdNamespace("METAMODEL", Transforms.Key).Bind As IMsMetaModel;
Model := mb.ItemByIdNamespace("MODEL", Transforms.Key).Edit As IMsModel;
Transform := Model.Transform;
Input := Transform.Inputs.Item(0);
Slice := Input.Slices.Item(0);
Sel := Slice.Selection;
Atts := Catalog.Facts.Attributes;
Dict := Atts.FindById("COUNTRY").ValuesObject;
dimInst := Dict.Open(Null) As IDimInstance;
dimSel := Sel.Add(dimInst);
dimSel.SelectElement(0, False);
Params := MetaModel.Params;
pr := Params.Item(0);
paramDim := Slice.ParametrizedDimensions;
paramD := paramDim.Item(0);
paramD.Parameter := pr;
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example parameterized dimension is set for the model variable slice.
Executing the example requires that the repository contains a time series database with the FC_PARAM identifier. This database contains the COUNTRY attribute that refers to the dictionary. Modeling container of the database contains a metamodel with the META_MODEL identifier and a model with the MODEL identifier. A parameter, that refers to the same dictionary as the COUNTRY attribute, is set for the metamodel.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Catalog: IRubricator;
Transforms: IMetabaseObjectDescriptor;
MetaModel: IMsMetaModel;
Model: IMsModel;
Transform: IMsFormulaTransform;
Input: IMsFormulaTransformVariable;
Slice: IMsFormulaTransformSlice;
Sel: IDimSelectionSet;
Atts: IMetaAttributes;
Dict: IMetabaseObjectDescriptor;
dimInst: IDimInstance;
dimSel: IDimSelection;
ModelParams: IMsModelParams;
paramDim: IMsParametrizedDimensions;
paramD: IMsParametrizedDimension;
pr: IMsModelParam;
Begin
mb := Params.Metabase;
Catalog := mb.ItemById["FC_PARAM"].Bind() As IRubricator;
Transforms := Catalog.ModelSpace;
MetaModel := mb.ItemByIdNamespace["METAMODEL", Transforms.Key].Bind() As IMsMetaModel;
Model := mb.ItemByIdNamespace["MODEL", Transforms.Key].Edit() As IMsModel;
Transform := Model.Transform;
Input := Transform.Inputs.Item[0];
Slice := Input.Slices.Item[0];
Sel := Slice.Selection;
Atts := Catalog.Facts.Attributes;
Dict := Atts.FindById("COUNTRY").ValuesObject;
dimInst := Dict.Open(Null) As IDimInstance;
dimSel := Sel.Add(dimInst);
dimSel.SelectElement(0, False);
ModelParams := MetaModel.Params;
pr := ModelParams.Item[0];
paramDim := Slice.ParametrizedDimensions;
paramD := paramDim.Item[0];
paramD.Parameter := pr;
(Model As IMetabaseObject).Save();
End Sub;
After executing the example parameterized dimension is set for the model variable slice.
See also: