DataSourceTotalsDefined: Boolean;
The DataSourceTotalsDefined property returns whether the configured aggregation for data source facts is present.
The property returns True if an aggregation, calculated on the server, is set for data source facts. For aggregation use any method, except Count and CountDistinct.
Add a result with the PivotEvaluatorElementType.DataSource type to include aggregated data as a result that is calculated in the table.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier.
Sub Main;
Var
MB: IMetabase;
OLAP: IEaxAnalyzer;
Pivot: IPivot;
Totals: IPivotEvaluatorTotals;
Begin
MB := MetabaseClass.Active;
OLAP := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
Pivot := OLAP.Pivot;
Totals := Pivot.Evaluator.Totals;
If Totals.DataSourceTotalsDefined Then
Totals.RowTypes := Totals.RowTypes + PivotEvaluatorElementType.DataSource;
End If;
Pivot.Refresh;
(OLAP As IMetabaseObject).Save;
End Sub Main;
After executing this example, a list of results that are calculated in express report is changed. If there are settings of server aggregation for express report data source facts, a total is included into the list of totals that are calculated in express report by rows. Method of total result calculation corresponds with the method that is set in aggregation settings for data source facts.
See also: