The clsPartitionAnalyzer CloseAggregationAnalysis method closes this clsPartitionAnalyzer session and clears the temporary objects used during the analysis.
dsoPartAnalyzer. CloseAggregationAnalysis
This method does not permanently save the DesignedAggregations collection in the partition. It clears the temporary objects used during the analysis. If you wish to save the results from a clsPartitionAnalyzer session you must do so programmatically. The sections in the following example show how to save the results of an analysis in the partition.
Use the following code to run several analysis steps, save the results, and close the analysis. The analysis continues until one of the following two goals is reached:
For more information, see InitializeDesign.
'Assume the existence of an object (dsoPart) of ClassType
'clsPartition and an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer
Private blnStopAdding As Boolean
Dim dblPercentageBenefit As Double
Dim dblAccumulatedSize As Double
Dim lngAggregationsCount As Long
dsoPartAnalyzer.InitializeDesign
'Iterate thru analysis until either goal is reached
Do Until blnStopAdding
If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _
dblAccumulatedSize, lngAggregationsCount) Then
blnStopAdding = True 'No New Aggregations Designed
Else
blnStopAdding = (lngAggregationsCount >= 20) Or _
(dblAccumulatedSize >= 100000)
End If
Loop
'Delete existing aggregations
Do While dsoPart.MDStores.Count
dsoPart.MDStores.Remove 1
Loop
'Add designed aggregations to partition
For Each Agg In dsoPartAnalyzer.DesignedAggregations
dsoPart.MDStores.Add Agg
Next Agg
dsoPartAnalyzer.CloseAggregationAnalysis 'Close analysis
clsAggregation | Properties Cross-Reference |
clsPartition | Using Decision Support Objects |
clsPartitionAnalyzer |