Threshold: Double;
Threshold: Double;
The Threshold property determines the threshold value, relative to which the data is filtered in the 80/20 analysis.
The property is relevant if the IPivotParetoSettingsItem.Display property is set to True.
Depending on the type of value selection, set in the IPivotParetoSettingsItem.Kind property, the following values are available in the Threshold property:
Selection percent as a decimal if the IPivotParetoSettingsItem.Kind property is set to PivotParetoKind.Percent.
An integer that determines the number of values if the IPivotParetoSettingsItem.Kind property is set to PivotParetoKind.Count. If a real number is set, it will be rounded to the nearest integer value.
A real number that is a limit of sum of selected values if the IPivotParetoSettingsItem.Kind property is set to PivotParetoKind.Sum.
By default, for parameters of analysis the Threshold property is set to 0.2 by columns and 0.8 by rows.
Executing the example requires that the repository contains an express report with the EXPRESS identifier containing a table.
Add links to the Express, Metabase, and Pivot system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
Pivot: IPivot;
ColumnSettings: IPivotParetoSettings;
BottomSettings: IPivotParetoSettingsItem;
TopSettings: IPivotParetoSettingsItem;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get express report
Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get express report table
Pivot := Analyzer.Pivot;
// Apply distribution in columns
ColumnSettings := Pivot.Pareto.ColumnsSettings;
// Enable analysis for the first column
ColumnSettings.Enabled := True;
ColumnSettings.ElementIndex := 0;
ColumnSettings.OtherAggregation := PivotEvaluatorElementType.Avg;
// Get maximum values of the analyzed column
TopSettings := ColumnSettings.TopSettings;
// Change calculation type
TopSettings.Kind := PivotParetoKind.Count;
// Enable displaying of cells with maximum values
TopSettings.Display := True;
// Change the number of displayed cells with maximum values
TopSettings.Threshold := 2;
// Get minimum values of the analyzed column
BottomSettings := ColumnSettings.BottomSettings;
// Change calculation type
BottomSettings.Kind := PivotParetoKind.Count;
// Enable displaying of cells with minimum values
BottomSettings.Display := True;
// Change the number of displayed cells with minimum values
BottomSettings.Threshold := 2;
// Save changes
(Analyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the Top/Bottom analysis is applied to the first column of express report table according to the set parameters:
Two cells with minimum values are displayed.
Two cells with maximum values are displayed.
Average is calculated for the rest of data.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Tab;
Public Shared Sub Main1(Params: StartParams);
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
Pivot: IPivot;
ColumnSettings: IPivotParetoSettings;
BottomSettings: IPivotParetoSettingsItem;
TopSettings: IPivotParetoSettingsItem;
Begin
// Get repository
Metabase := Params.Metabase;
// Get express report
Analyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get express report table
Pivot := Analyzer.Pivot;
// Apply 80/20 analysis to columns
ColumnSettings := Pivot.Pareto.ColumnsSettings;
// Enable analysis only for the first column
ColumnSettings.Enabled := True;
ColumnSettings.ElementIndex := 0;
ColumnSettings.OtherAggregation := PivotEvaluatorElementType.peetAvg;
// Get maximum values of the analyzed column
TopSettings := ColumnSettings.TopSettings;
// Change calculation type
TopSettings.Kind := PivotParetoKind.ppkCount;
// Enable displaying of cells with maximum values
TopSettings.Display := True;
// Change the number of displayed cells with maximum values
TopSettings.Threshold := 2;
// Get minimum values of the analyzed column
BottomSettings := ColumnSettings.BottomSettings;
// Change calculation type
BottomSettings.Kind := PivotParetoKind.ppkCount;
// Enable displaying of cells with minimum values
BottomSettings.Display := True;
// Change the number of displayed cells with minimum values
BottomSettings.Threshold := 2;
// Save changes
(Analyzer As IMetabaseObject).Save();
End Sub;
See also: