DesignedAggregations (clsPartitionAnalyzer)
The DesignedAggregations collection of an object of ClassType clsPartitionAnalyzer acts as a temporary container for aggregation objects during the partition analyzer session.
Data Type
VBA.Collection
Access
Read-only
Remarks
This collection contains aggregations (that is, objects of ClassType clsAggregation) that were added manually using the AddExistingAggregation method or were automatically generated using the NextAnalysisStep method. At the conclusion of the partition analyzer session you can either save the aggregations to the partition (and make them available for client applications) or discard them.
Example
Use the following code to repeatedly invoke the NextAnalysisStep method and then save the DesignedAggregations in a Microsoft® Visual Basic® collection. The analysis continues until one of the following goals is reached:
- Twenty or more aggregations are designed.
- The storage requirements for the designed aggregations exceed 100,000 bytes.
For more information, see InitializeDesign.
'Assume the existence of objects (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer and (dsoPartition) of ClassType clsPartition.
Private blnStopAdding As Boolean
Private colDesignedAggs As Collection
dsoPartAnalyzer.InitializeDesign
'Iterate through 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
'Save the designed aggregations to the partition.
Dim dsoAggregation As DSO.MDStore
For Each dsoAggregation In dsoPartAnalyzer.DesignedAggregations
dsoPartition.MDStores.Add dsoAggregation
Next