Named and Unnamed Levels

OLE DB Programmer's Reference

A data source object supports named levels if it can refer to all members at a particular level of a hierarchy by a name. In the SalesData cube, Continents is the name of the member set at level 1 (root = 0) of the hierarchy. This set has the members {Europe, North America}.

Not all multidimensional data stores support named levels. Many data stores support the concept of a level as a set of members that occur at a given distance from the root of the hierarchy. In such a data store, you cannot give the name "Continents" to a set of members but must instead determine the distance from the root of the World-Continent hierarchy.

OLE DB for OLAP does not require a data store to support named levels. The LEVELS and MEMBERS rowsets contain information about both the level name and the level position (that is, the distance of the level from the root). OLE DB for OLAP does require providers not supporting named levels to create a dummy level name containing all members of a hierarchy (or a dimension). The dummy name must be the name of the dimension.

The MEMBERS rowset contains additional columns for each property at the end of the rowset. When asking for the MEMBERS rowset, OLE DB for OLAP requires that the restrictions together unambiguously identify a level. When the provider does not support named levels, all members belong to a dummy level. Consequently, a restriction based on the LEVEL_NAME column has no effect. The consumer can specify additional restrictions on LEVEL_NUMBER, MEMBER_NAME, PARENT_UNIQUE_NAME, and so on. The resulting rowset will have property columns for the union of the properties of each member in the rowset. Each row in the rowset (which describes a member) will have values for property columns that apply to that member. Values for all other property columns are NULL.

Returning "Dummy Names" for Numbered (Unnamed) Levels

For providers that do not support named levels, it is recommended that they return "dummy" level names for each numbered level in the schema rowsets. A simple algorithm, such as naming level 2 as "Level_2," can generate these dummy names; or they can be something more meaningful, such as naming level 2 of the SalesRep dimension as "General Manager."

Generic OLAP clients use the columns of the schema rowset to populate the display; for example, a drop-down list of levels might be populated by the LEVEL_NAME field of the LEVELS schema rowset. By generating dummy names, providers enable such applications to write consistent display code whether or not a provider supports named levels.

Consumers should not use these dummy names in an MDX statement. (A provider that does not support named levels will return an error in this case.) Level names should be used in an MDX statement only if the provider has full support for named levels.

Whether a provider supports named levels, numbered levels with dummy level names, or just numbered levels can be determined by looking at the value of the data source property MDPROP_NAMED_LEVELS.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net