SkipIfWholeWeightIsEmpty: Boolean;
SkipIfWholeWeightIsEmpty: boolean;
The SkipIfWholeWeightIsEmpty property determines whether a series is excluded from aggregation if all series weights are empty.
The default value is False.
If the value is True, the series is excluded from aggregation, if all weights for this series are empty; if the value is False, the series is taken into account when calculating aggregation regardless of weights values.
The weights are taken into account if the calculation uses a weighted aggregation method, for example, weighted sum. If there are any empty weight values, the result of aggregation is empty.
Executing the example requires that the repository contains a time series database with the TSDB identifier, modeling container of which contains an extended aggregation model with the MODEL_AGGR identifier. The model is calculated by the weighted aggregation method.
Add links to the Metabase, Cubes, Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Rubr: IRubricator;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
ModelFormula: IMsFormula;
CrossDimAggr: IMsCrossDimensionAggregationTransform;
AggrOptions: IMsCrossDimensionAggregationOptions;
Begin
Mb := MetabaseClass.Active;
Rubr := Mb.ItemById("TSDB").Bind As IRubricator;
MsDescr := Rubr.ModelSpace;
// Get extended aggregation model
Model := Mb.ItemByIdNamespace("MODEL_AGGR", MsDescr.Key).Edit As IMsModel;
ModelFormula := Model.Transform.FormulaItem(0);
CrossDimAggr := ModelFormula.Method As IMsCrossDimensionAggregationTransform;
// Change aggregation calculation parameters
AggrOptions := CrossDimAggr.Options;
// Exclude from aggregation series with all empty weights
AggrOptions.SkipIfWholeWeightIsEmpty := True;
// Set values for missing data substitution in calculation threshold data
AggrOptions.TreatEmptyCompositionRelevanceAs := 0;
// Exclude from aggregation series, which have missing data in weight values
AggrOptions.TreatEmptyWeightsAs := 0;
// Specify that aggregation is calculated in common data period
AggrOptions.UseCommon := True;
{ Impose constraint on minimum number of observations
in common data period are five values}
AggrOptions.UseNumObservations := True;
AggrOptions.NumObservations := 5;
// Save changes of model parameters
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example parameters of extended aggregation calculation are changed:
The series with all empty weights are excluded from aggregation calculation.
The series that have missing values in weights values are excluded from aggregation calculation.
The 0 value is used to substitute missing data in aggregation calculation threshold data.
Aggregation is calculated in the common data period.
Minimum number of observations in the common period is five.
Executing the example requires that the repository contains a time series database with the TSDB identifier, modeling container of which contains an extended aggregation model with the MODEL_AGGR identifier. The model is calculated by the weighted aggregation method.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Ms;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Rubr: IRubricator;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
ModelFormula: IMsFormula;
CrossDimAggr: IMsCrossDimensionAggregationTransform;
AggrOptions: IMsCrossDimensionAggregationOptions;
Begin
Mb := Params.Metabase;
Rubr := Mb.ItemById["TSDB"].Bind() As IRubricator;
MsDescr := Rubr.ModelSpace;
// Get extended aggregation model
Model := Mb.ItemByIdNamespace["MODEL_AGGR", MsDescr.Key].Edit() As IMsModel;
ModelFormula := Model.Transform.FormulaItem[0];
CrossDimAggr := ModelFormula.Method As IMsCrossDimensionAggregationTransform;
// Change aggregation calculation parameters
AggrOptions := CrossDimAggr.Options;
// Exclude from aggregation series with all empty weights
AggrOptions.SkipIfWholeWeightIsEmpty := True;
// Set values for missing data substitution in calculation threshold data
AggrOptions.TreatEmptyCompositionRelevanceAs := 0;
// Exclude from aggregation the series, which have missing data in weight values
AggrOptions.TreatEmptyWeightsAs := 0;
// Specify that aggregation is calculated in common data period
AggrOptions.UseCommon := True;
{ Impose constraint on minimum number of observations
in common data period are five values}
AggrOptions.UseNumObservations := True;
AggrOptions.NumObservations := 5;
// Save changes of model parameters
(Model As IMetabaseObject).Save();
End Sub;
The result of the example execution matches with that of the Fore example.
See also: