MissingData: IMissingData;
MissingData: Prognoz.Platform.Interop.Stat.IMissingData;
The MissingData property returns parameters of gap handling method.
The property is outdated, use IMsCrossDimensionAggregationTransform.AppliesToExpression.
Executing the example requires a form, a button with the Button1 identifier located on this form, the LanerBox component LanerBox1 identifier, and the UiErAnalyzer component that is used as data source for LanerBox. UiErAnalyzer must contain the workbook of the time series database. COUNTRY and INDICATOR are time series database attributes that refer to dictionaries.
Add links to the Cubes, Dimensions, Laner, Metabase, Ms, Rds, Stat system assemblies.
This example is a handler of the OnClick event for Button1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
mb: IMetabase;
Laner: ILaner;
CalcSerie: ILanerCalculateSerie;
Transform: IMsFormulaTransform;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Method: IMsMethod;
Aggr: IMsCrossDimensionAggregationTransform;
TransformVar: IMsFormulaTransformVariable;
Options: IMsCrossDimensionAggregationOptions;
FilterList: IMsAggregationFilterList;
Filter: IMsAggregationFilter;
Rubr: IRubricator;
Attributes: IMetaAttributes;
DictDescr: IMetabaseObjectDescriptor;
FilterDimension: IMetabaseObject;
DimInst: IDimInstance;
Selection: IDimSelection;
i: Integer;
MissingData: IMissingData;
Begin
mb := MetabaseClass.Active;
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
CalcSerie := Laner.Series.AddCalculateSerie("Aggregation");
Transform := CalcSerie.Transform.Transform As IMsFormulaTransform;
Selector := Transform.CreateSelector;
TransformVar := Transform.Outputs.Item(0);
Selector.Slice := TransformVar.Slices.Add(Null);
Formula := Transform.Transform(Selector);
Formula.Kind := MsFormulaKind.CrossDimensionAggregation;
Method := Formula.Method;
// Set up aggregation
Aggr := Method As IMsCrossDimensionAggregationTransform;
// Set the aggregation method
Aggr.AgregationMethod := MsAgregationMethodType.Sum;
// Determine the additional parameters of aggregation
Options := Aggr.Options;
Options.Threshold := 0;
Options.Level := False;
Options.Rebase := False;
// Set up aggregation filter
FilterList := Aggr.Filter;
FilterList.Clear;
Rubr := Laner.RubricatorInstance.Rubricator;
Attributes := Rubr.Facts.Attributes;
DictDescr := Attributes.FindById("COUNTRY").ValuesObject;
Filter := FilterList.Add(DictDescr.Bind As IDimensionModel);
FilterDimension := Filter.FilterDimension As IMetabaseObject;
DimInst := FilterDimension.Open(Null) As IDimInstance;
Selection := DimInst.CreateSelection;
For i := 0 To 5 Do
Selection.SelectElement(i, False);
End For;
Filter.AggregationSelection := Selection;
// Set the dimension by which the aggregation is performed
DictDescr := Attributes.FindById("INDICATOR").ValuesObject;
Aggr.AggregationDimenson := DictDescr.Bind As IDimensionModel;
// Set aggregation expression
Aggr.Expression.AsString := "BCA";
// Set missing data treatment method
MissingData := Aggr.MissingData;
MissingData.Method := MissingDataMethod.Casewise;
LanerBox1.ExecuteOperation(LanerBoxOperation.Refresh);
End Sub Button1OnClick;
After executing the example the new calculated series Aggregation calculated by the aggregation method will be added to the LanerBox component. Aggregation is calculated as a sum of the BCA time series values for the first six countries of the dictionary, to which the COUNTRY attribute refers. The calculation is performed without considering missing values of the series. For example:
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Rds;
Imports Prognoz.Platform.Interop.Stat;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
mb: IMetabase;
Laner: ILaner;
CalcSerie: ILanerCalculateSerie;
Transform: IMsFormulaTransform;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Method: IMsMethod;
Aggr: IMsCrossDimensionAggregationTransform;
TransformVar: IMsFormulaTransformVariable;
Options: IMsCrossDimensionAggregationOptions;
FilterList: IMsAggregationFilterList;
Filter: IMsAggregationFilter;
Rubr: IRubricator;
Attributes: IMetaAttributes;
DictDescr: IMetabaseObjectDescriptor;
FilterDimension: IMetabaseObject;
DimInst: IDimInstance;
Selection: IDimSelection;
i: uinteger;
MissingData: IMissingData;
Begin
mb := Self.Metabase;
Laner := uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.Laner;
CalcSerie := Laner.Series.AddCalculateSerie("Aggregation", DimCalendarLevel.dclNone, -1);
Transform := CalcSerie.Transform.Transform As IMsFormulaTransform;
Selector := Transform.CreateSelector();
TransformVar := Transform.Outputs.Item[0];
Selector.Slice := TransformVar.Slices.Add(Null);
Formula := Transform.Transform[Selector];
Formula.Kind := MsFormulaKind.mfkCrossDimensionAggregation;
Method := Formula.Method;
// Set up aggregation
Aggr := Method As IMsCrossDimensionAggregationTransform;
// Set the aggregation method
Aggr.AgregationMethod := MsAgregationMethodType.mammtSum;
// Determine the additional parameters of aggregation
Options := Aggr.Options;
Options.Threshold := 0;
Options.Level := False;
Options.Rebase := False;
// Set up aggregation filter
FilterList := Aggr.Filter;
FilterList.Clear();
Rubr := Laner.RubricatorInstance.Rubricator;
Attributes := Rubr.Facts.Attributes;
DictDescr := Attributes.FindById("COUNTRY").ValuesObject;
Filter := FilterList.Add(DictDescr.Bind() As IDimensionModel);
FilterDimension := Filter.FilterDimension As IMetabaseObject;
DimInst := FilterDimension.Open(Null) As IDimInstance;
Selection := DimInst.CreateSelection();
For i := 0 To 5 Do
Selection.SelectElement(i, False);
End For;
Filter.AggregationSelection := Selection;
// Set the dimension by which the aggregation is performed
DictDescr := Attributes.FindById("INDICATOR").ValuesObject;
Aggr.AggregationDimenson := DictDescr.Bind() As IDimensionModel;
// Set aggregation expression
Aggr.Expression.AsString := "BCA";
// Set missing data treatment method
MissingData := Aggr.MissingData;
MissingData.Method := MissingDataMethod.mdmCasewise;
lanerBoxNet1.CtrlBox.ExecuteOperation(LanerBoxOperation.lboRefresh, Null);
End Sub;
See also: