AddGoalQuery (clsPartitionAnalyzer)

Analysis Services Programming

Analysis Services Programming

AddGoalQuery (clsPartitionAnalyzer)

The AddGoalQuery method of an object of ClassType clsPartitionAnalyzer describes a specific aggregation that is to be generated during a partition analyzer session.

Syntax

object. AddGoalQuery(ByVal DatasetName As String, ByVal Frequency As Double)

object

The object of ClassType clsPartitionAnalyzer used to perform the analysis.

DatasetName

A numeric string that specifies which level from each dimension is to be included in the query. This string must have the same number of characters as the number of dimensions in the partition. For example, the string "223" would refer to a query involving three dimensions, using the second level from the first dimension, the second level from the second dimension, and the third level from the third dimension.

Frequency

A weighting factor that corresponds to the number of times that an existing DatasetName query has previously been executed. If this DatasetName is a new query, the value of Frequency that is entered is used to weight the partition analysis. As the frequency becomes greater, the weight that is placed on the query during the analysis increases.

Remarks

The analysis performed by the partition analyzer can be constrained to optimize a particular subset of queries. Each of the queries in this subset is called a goal query and is specified by picking a level from each of the dimensions of the partition. This method adds the goal query to an internal collection that is used to generate the aggregations.

Goal queries can be obtained from the query log database maintained by the Analysis server. The clsCubeAnalyzer object can retrieve query log recordsets containing the dataset names of logged queries for a specific cube. For more information about query log recordsets, see OpenQueryLogRecordset (clsCubeAnalyzer).

You do not have to select goal queries before running the NextAnalysisStep method to generate aggregations. The clsPartitionAnalyzer object will create a generic set of aggregations without guidance. However, if you do specify one or more goal queries, the partition analyzer will create aggregations according to your requests only.

Different goal query subsets can be optimized with significantly different members of the DesignedAggregations collection. The performance and storage requirements may warrant constructing separate partitions for each goal query subset.

The levels referenced in the DatasetName string are identified by matching each numeric value with a dimension. The order of reference is determined by the order of levels in the Dimensions collection of the partition.

Example

Assume that a partition contains the following dimensions and levels.

  Customers dimension Products dimension Store Locations dimension
Level #1 All All All
Level #2 Groups Brand Country
Level #3 Customer# SKU State
Level #4     City

A particular group of users needs to perform the following queries:

  • All customers (Level #1) by product SKU (Level #3) by city (Level #4)

    This goal query aggregation is specified with DatasetName = "134"

  • Individual customers (Level #3) by all products (Level #1) by state (Level #3)

    DatasetName = "313"

  • Customer groups (Level #2) by brand (Level #2) by country (Level #2)

    DatasetName = "222"

Use the following code to add these goal queries. For more information, see InitializeDesign.

' Assume the existence of an object (dsoPartAnalyzer) of ClassType
' clsPartitionAnalyzer.
' First, call InitializeDesign.
dsoPartAnalyzer.InitializeDesign

' Add goal queries.
dsoPartAnalyzer.AddGoalQuery "134", 1
dsoPartAnalyzer.AddGoalQuery "313", 1
' Because the following goal query is executed more often than
' the other two, a higher frequency value is assigned to give
' it more weight when being considered for aggregation purposes.
dsoPartAnalyzer.AddGoalQuery "222", 5

' Required after all goal queries have been added.
dsoPartAnalyzer.PrepareGoalQueries

You can now run a series of NextAnalysisStep methods until you achieve the level optimization you want.

See Also

clsAggregation

clsPartition

clsPartitionAnalyzer

NextAnalysisStep

clsCubeAnalyzer