IMsCrossDimensionAggregationOptions.SkipIfWholeWeightIsEmpty

Fore Syntax

SkipIfWholeWeightIsEmpty: Boolean;

Fore.NET Syntax

SkipIfWholeWeightIsEmpty: boolean;

Description

The SkipIfWholeWeightIsEmpty property determines whether a series should be excluded from aggregation if all series weights are empty.

Comments

Default property 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.

Fore Example

Executing the example requires that 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 the model of the extended aggregation
    Model := Mb.ItemByIdNamespace("MODEL_AGGR", MsDescr.Key).Edit As IMsModel;
    ModelFormula := Model.Transform.FormulaItem(0);
    CrossDimAggr := ModelFormula.Method As IMsCrossDimensionAggregationTransform;
    // Change the aggregation calculation parameters
    AggrOptions := CrossDimAggr.Options;
    // Exclude from the aggregation the series with all empty weights
    AggrOptions.SkipIfWholeWeightIsEmpty := True;
    // Set values for missing data substitution in the calculation threshold data
    AggrOptions.TreatEmptyCompositionRelevanceAs := 0;
    // Exclude from the aggregation the series, which have missing data in the weight values
    AggrOptions.TreatEmptyWeightsAs := 0;
    // Specify, that the aggregation is calculated on the common data period
    AggrOptions.UseCommon := True;
    { Impose the constraint on the minimum number of observations
    in the 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:

Fore.NET Example

Executing the example requires that 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 the model of the extended aggregation
    Model := Mb.ItemByIdNamespace["MODEL_AGGR", MsDescr.Key].Edit() As IMsModel;
    ModelFormula := Model.Transform.FormulaItem[0];
    CrossDimAggr := ModelFormula.Method As IMsCrossDimensionAggregationTransform;
    // Change the aggregation calculation parameters
    AggrOptions := CrossDimAggr.Options;
    // Exclude from the aggregation the series with all empty weights
    AggrOptions.SkipIfWholeWeightIsEmpty := True;
    // Set values for missing data substitution in the calculation threshold data
    AggrOptions.TreatEmptyCompositionRelevanceAs := 0;
    // Exclude from the aggregation the series, which have missing data in the weight values
    AggrOptions.TreatEmptyWeightsAs := 0;
    // Specify, that the aggregation is calculated on the common data period
    AggrOptions.UseCommon := True;
    { Impose the constraint on the minimum number of observations
    in the 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:

IMsCrossDimensionAggregationOptions