A local cube is defined in terms of the measures and definitions that define it. There are two types of dimensions.
-
Source dimensions - These are dimensions that were part of one of more source cubes
-
Derived dimensions - These are dimensions that provide new analysis capabilities. A derived dimension can be a regular dimension defined based on a source dimension that is either sliced vertically or horizontally, or contains custom grouping of dimension members. A derived dimension can also be a data mining dimension based on a data mining model.
Note: |
|---|
|
The Dimension keyword can refer to either dimensions or hierarchies.
|
In a local cube, you can perform the following tasks:
-
Eliminate dimensions that exist in the source cube
-
Add or eliminate hierarchies from a dimension
-
Eliminate measure groups or specific measures
The CREATE GLOBAL CUBE statement follows these rules:
-
The CREATE GLOBAL CUBE statement automatically copies all commands, such as calculated measures or actions, to the local cube. If a command contains a Multidimensional Expressions (MDX) expression that references the parent cube explicitly, the local cube cannot run that command. To prevent this problem, use the CURRENTCUBE keyword when defining MDX expressions for commands. The CURRENTCUBE keyword uses the current cube context when referencing a cube within an MDX expression.
-
A global cube that is created from an existing global cube in a local cube file cannot be saved in the same local cube file. For example, you create a global cube named SalesLocal1 and save this cube to the C:\SalesLocal.cub file. You then connect to the C:\SalesLocal.cub file and create a second global cube named SalesLocal2. If you now try to save the SalesLocal2 global cube to the C:\SalesLocal.cub file, you will receive an error. However, you can save the SalesLocal2 global cube to a different local cube file.
-
Global cubes do not support distinct count measures. Because cubes that include distinct count measures are nonadditive, the CREATE GLOBAL CUBE statement cannot support the creation or use of distinct count measures.
-
When adding a measure to a local cube, you must also include at least one dimension that is related to the measure being added.
-
When adding a parent-child hierarchy to a local cube, levels and filters on a parent-child hierarchy are ignored and the entire parent-child hierarchy is included.
-
Member properties are not supported in local cubes.
-
You cannot create a local cube from a perspective.
-
When you include a semi-additive measure to a local cube, the following rules apply:
-
You must include the Account dimension if the AggregateFunction property for the measure being added is ByAccount.
-
You must include the entire Time dimension if the AggregateFunction property measure being added is FirstChild, LastChild, FirstNonEmpty, LastNonEmpty, or AverageOfChildren.
-
Data mining dimensions cannot be added to a local cube.
-
Reference dimensions are materialized and added as regular dimensions.
-
When you include a many-to-many dimension, the following rules apply:
-
You must add the entire many-to-many dimension.
-
You must add the intermediary measure group.
-
You must add the entirety of all dimensions common to the two measure groups involved in the many-to-may relationship.
The following example demonstrates creating a local, persisted version of the Adventure Works cube that contains only the Reseller Sales Amount measure, the Reseller dimension, and the Date dimension.
CREATE GLOBAL CUBE [LocalReseller]
Storage 'C:\LocalAWReseller1.cub'
FROM [Adventure Works]
(
MEASURE [Adventure Works].[Reseller Sales Amount],
DIMENSION [Adventure Works].[Reseller],
DIMENSION [Adventure Works].[Date]
)
The following example demonstrates slicing when you create a local cube. The global cube that is created is based on the Adventure Works cube sliced vertically by the 2005 member of the Fiscal Year level, and horizontally by the Fiscal Year and Month levels.
CREATE GLOBAL CUBE [LocalReseller]
Storage 'C:\LocalAWReseller2.cub'
FROM [Adventure Works]
(
MEASURE [Adventure Works].[Reseller Sales Amount],
DIMENSION [Adventure Works].[Reseller],
DIMENSION [Adventure Works].[Date]
(
LEVEL [Fiscal Year],
LEVEL [Month],
MEMBER [Date].[Fiscal].[Fiscal Year].&[2005]
)
)