Measure Interface
[!附註]
下一版的 Microsoft SQL Server 將不再提供此功能。請勿在新的開發工作中使用此功能,並且儘速修改使用此功能的應用程式。
Measures are the quantitative, numerical columns from the fact table of a cube. When a cube is processed, the data in the measures is aggregated across the dimensions in the cube. The aggregate functions are: Sum, Min, Max, Count, and Distinct Count.
In Decision Support Objects (DSO), the objects that implement the Measure interface have a ClassType property value of clsCubeMeasure, clsPartitionMeasure, or clsAggregationMeasure. These objects serve as containers for measure objects within each respective parent object. The Measure interface provides collections and properties that allow you to manipulate these objects. There are no methods associated with this interface. For more information about cube, partition, and aggregation objects, and how they relate to each other, see Introducing Decision Support Objects.
Not all of the objects that implement the Measure interface implement all of the properties of the interface. The properties of some objects may be restricted to read-only access, depending upon their type. For example, a clsCubeMeasure object allows read and write access to its FormatString property. Access to this property for any other measure object is read-only. The collections and properties of the Measure interface also apply to the measures of virtual cubes, although no special class is implemented for virtual cube measures. There are no methods associated with the Measure interface.
To illustrate the place of measures in a fact table, consider the case of a database that contains the following tables:
Sales_Facts
Customer
Product
Promotion
Product_Class
Store
Calendar
The following diagram illustrates the relationships of these tables.
If you build a cube based upon this database, the Sales_Facts table will be the fact table. The related tables will be the dimensions. The Sales_Quantity, Unit_Price, and Unit_Cost rows are measures that can be precalculated across dimensions such as Store, Customer, or Product.