文档介绍:Using MDX
Review
Dimension
Dimension attribute
Member
A member is a value of a dimension attribute
Measure
A measure is a value from a fact table, and is also called a fact
MDX Definition
MultiDimensional eXpressions
Part of OLEDB for online analytical processing (OLAP) specification
Now part of XML for Analysis (XML/A) specification
Designed for multidimensional reporting and analysis
MDX Roles
Query Statements
Source of reports (similar to SQL)
Return data to a client application
Format query results
Perform cube design tasks, including the definition of calculated members, Formulas, named sets, scoped assignments, and key performance indicators (KPIs).
Perform administrative tasks, including dimension and cell security.
Management Functions
Alter cube, update cube, etc.
Goals
Use multidimensional expressions (MDX) to calculate contribution percentages.
Execute MDX queries using SQL Server Management Studio.
Use set functions.
Create calculated members that aggregate sets of values.
Use script assignments to change cube values.
Create key performance indicators (KPIs).
Creating Tuple-Based Calculated Members (1)
([January],[Chain])
Creating Tuple-Based Calculated Members (2)
([North America],[Mountain-100 Black, 38],[Time].[All])
Creating Tuple-Based Calculated Members (3)
The generic term for a coordinate that includes one or more dimensions is a plete tuple, partial tuple
One member from each attribute hierarchy
Omitted attribute hierarchy use CurrentMember
Include Measures dimension in tuple to uniquely identify a value
Creating Tuple-Based Calculated Members (4)
Create Set-based calculated members
AVG
SUM
PeriodsToDate