Defining Virtual cubes
Virtual Cubes can be defined as a combination of multiple cubes into one logical cube. Virtual cubes resemble relational database views in so far as they combine other views and tables. A virtual cube is created by selecting measures and dimensions from a consolidated set of dimensions and measures underlying component cubes. End users will see the virtual cube as a single cube. Virtual cubes can also be created out a single cube with an aim to expose certain subsets of its measures and dimensions. Virtual cubes can also include linked cubes and normal cubes in its component parts.
Benefits of using virtual cubes
Virtual cubes only store definitions of the different component dimensions of cubes and not the data therein. Therefore, they do not require much storage space. Virtual cubes can be used to create combinations and variations of existing cubes without requiring additional storage space.
Virtual cubes provide a unique security function by limiting access of certain users when viewing the data of underlying cubes.
Virtual cubes are also useful while working with data mining models. We will learn more about this in a later chapter “Introduction to Data Mining”.
Once the virtual cube is created, it must be processed so that the internal links to the specified dimensions and measures are established. This linking operation is performed quickly and the processing of the virtual cube automatically triggers processing of all underlying cubes that need to be processed.
Working with Virtual Cubes
The first condition to working with virtual cubes is that they must be added to the database as a cube with the SubClassType parameter set to sbclsVirtual. Dimensions and measures are then added to it as and when needed.
All dimensions and measures of a virtual cube are derived from previously defined cubes within the database. All levels associated with a dimension become a part of the virtual cube’s dimension.
Partitions and aggregations will not apply to virtual cubes.
Any change in the structure of a virtual cube requires that the cube be reprocessed. Even an alteration to the structure of a regular cube used in a virtual cube demands that the virtual cube be reprocessed.
Virtual cubes can contain a number of source cubes including linked cubes that are available within the database.
The roles, calculated members and actions assigned to the source cubes will have to be recreated in the virtual cube as it does not automatically inherit these aspects. The user will have to study the underlying structure of the source cube and recreate them or he can design fresh aggregations, roles etc for his virtual cube.
Shared dimensions, other than the one’s included in the source cubes, but residing in the same database can be a part of the virtual cube. The only condition being that custom rollup expressions are available on their levels. The server finds these dimension data using these custom rollup expressions.
The properties and collections of a virtual cube are different from those of a regular cube in the following aspects.
1. Aggregation prefix: The virtual cube does not use aggregation prefix
2. Analyzer: A virtual cube does not have an analyzer object
3. DataSources: A virtual cube does not have a DataSources collection.
4. EstimatedRows: This property is read only and contains a number of rows from underlying cubes.
5. FromClause: A virtual cube does not have a FROM clause
6. JoinClause: A virtual cube does not have a Join Clause.
7. MDStores: For a virtual cube this collection contains the underlying cubes instead of the cube Partitions
8. OlapMode: A virtual cube does not use the OlapMode property.
9. SourceTable: virtual cubes do not have their own fact tables.
10. SourceTableAlias: Virtual cubes do not have their own fact tables.
11. SourceTableFilter: Virtual cubes do not have their own fact tables.
12. Dimension.DataSource: The Dimensions of the Virtual cubes do not have datasources.
Obtaining logical results
The virtual cube is like the view from a relational database in many ways. However, it is more restrictive. When the view of the data in a cube is created, parts of dimensions or measures cannot be used. A dimension or measure should be completely included or completely excluded. The virtual cube can be used for consolidation of data from multiple cubes, consolidation of individual cubes for comparison or customization of data for presentation to end users.