MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 22: OLE DB for OLAP Objects and Schema Rowsets


 

Axis Rowsets

There is one rowset for every axis. This rowset has at least 5n+1 columns, where n is the number of dimensions projected along the axis (because there are five default properties that are available for each axis, and one more column for the TUPLE_ORDINAL value). In addition, there might be provider-specific default properties, or the application might have selected additional properties by using the DIMENSION PROPERTIES clause. For this reason, it is possible for a dimension to have more than five columns. The rgcColumns field in the MDAXISINFO structure for this axis points to an array containing the number of columns in the axis rowset for this dimension.

The range rowset is a rowset in which each row corresponds to a cell in the dataset. Each selected cell property appears as a column in this rowset. Range rowsets provide the means for updating the axis rowset. For more information about these rowsets, see "Range Rowsets" in Chapter 23, "Rowsets in OLE DB for OLAP." Also in Chapter 23, see "Creating an Accessor to Fetch Data" for an explanation of how the application, before fetching cell data, can create an accessor that describes the structure of the data buffer.

The axis rowset has columns in the following order:

  1. TUPLE_ORDINAL column.

  2. Columns for the outermost dimension.

  3. Columns for dimensions with inner nestings.

The five default properties for each dimension, in order of their occurrence in the axis rowset, are as follows:

  1. MEMBER_UNIQUE_NAME. The unique name of the member. This is the same as the MEMBER_UNIQUE_NAME column of the MEMBERS rowset.

  2. MEMBER_CAPTION. The display name of the member. This is the same as the MEMBER_CAPTION column of the MEMBERS rowset.

  3. LEVEL_UNIQUE_NAME. The name of the level to which this member belongs. This is the same as the LEVEL_UNIQUE_NAME column of the MEMBERS rowset.

  4. LEVEL_NUMBER. The distance of the member from the root, which is zero. This is the same as the LEVEL_NUMBER column of the MEMBERS rowset.

  5. DISPLAY_INFO. This property contains various items of information that help an application render the axis. It is a 4-byte value. The value of the least-significant 2 bytes is a 16-bit unsigned integer that contains the number of children of a member. In the most-significant 2 bytes, each bit potentially conveys one piece of display information. For OLE DB, meanings are defined for only 2 bits (the least-significant bits), as shown in the following illustration.

    Note the following rules about DISPLAY_INFO:

To distinguish these column names, they are prefixed by <dimension_name>. For example, the column names for the SalesRep dimension are: "[SalesRep].[MEMBER_UNIQUE_NAME]", "[SalesRep].[MEMBER_CAPTION]", "[SalesRep].[LEVEL_UNIQUE_NAME]", "[SalesRep].[LEVEL_NUMBER]", "[SalesRep].[DISPLAY_INFO]".

The data type for the TUPLE_ORDINAL value is DBTYPE_UI4. The data types for the five mandatory properties are listed in the following table.

Default column properties Data type
MEMBER_UNIQUE_NAME DBTYPE_WSTR
MEMBER_CAPTION DBTYPE_WSTR
LEVEL_UNIQUE_NAME DBTYPE_WSTR
LEVEL_NUMBER DBTYPE_I4
DISPLAY_INFO DBTYPE_UI4

The data types of provider-specific properties and properties selected by using the DIMENSION PROPERTIES clause are available in the PROPERTIES schema rowset. This information is also available by calling IColumnsInfo on the rowset object corresponding to an axis rowset.

Axis Rowset Example

Consider the following dataset:

This dataset has two axes, x and y (0 and 1).

The x-axis has the following elements:

The y-axis has the following elements:

The MDAXISINFO structure for the x-axis has:

The MDAXISINFO structure for the y-axis has:

The axis rowset for the x-axis is shown in the following table. (The value of DISPLAY_INFO is shown in the form "x, y, z", where z = number of children, y = MDDISPINFO_DRILLED_DOWN, and x = MDDISPINFO_SAME_PARENT_AS_PREV.)

TUPLE_ORDINAL [SalesRep].[MEMBER_UNIQUE_NAME] [SalesRep].[MEMBER_CAPTION] [SalesRep].[LEVEL_UNIQUE_NAME] [SalesRep].[LEVEL_NUMBER] [SalesRep].[DISPLAY_INFO]
0 [SalesRep].[Venkatrao] Venkatrao RepName 1 0, 0, 0
1 [SalesRep].[Venkatrao] Venkatrao RepName 1 0, 0, 0
2 [SalesRep].[Venkatrao] Venkatrao RepName 1 0, 0, 0
3 [SalesRep].[Venkatrao] Venkatrao RepName 1 0, 0, 0
4 [SalesRep].[Netz] Netz RepName 1 0, 0, 0
5 [SalesRep].[Netz] Netz RepName 1 0, 0, 0
6 [SalesRep].[Netz] Netz RepName 1 0, 0, 0
7 [SalesRep].[Netz] Netz RepName 1 0, 0, 0

(This is the same table continued.)

[Geography].[MEMBER_UNIQUE_NAME] [Geography].[MEMBER_CAPTION] [Geography].[LEVEL_UNIQUE_NAME] [Geography].[LEVEL_NUMBER] [Geography].[DISPLAY_INFO]
[The World].[North America].[USA].[USA_North].[Seattle] Seattle City 5 0, 0, 0
[The World].[North America].[USA].[USA_North].[Boston] Boston City 5 1, 0, 0
[The World].[North America].[USA].[USA_South] Southern Region, USA Region 3 0, 0, 25
[The World].[Asia].[Japan] Japan Country 2 0, 0, 12
[The World].[North America].[USA].[USA_North].[Seattle] Seattle City 5 0, 0, 0
[The World].[North America].[USA].[USA_North].[Boston] Boston City 5 1, 0, 0
[The World].[North America].[USA].[USA_South] Southern Region, USA Region 3 0, 0, 25
[The World].[Asia].[Japan] Japan Country 2 0, 0, 12

The axis rowset for the y-axis follows. (The value of DISPLAY_INFO is shown in the form "x, y, z", where z = number of children, y = MDDISPINFO_DRILLED_DOWN, and x = MDDISPINFO_ SAME_PARENT_AS_PREV.)

TUPLE_ORDINAL [Quarters].[MEMBER_UNIQUE_NAME] [Quarters].[MEMBER_CAPTION] [Quarters].[LEVEL_UNIQUE_NAME] [Quarters].[LEVEL_NUMBER] [Quarters].[DISPLAY_INFO]
0 January January Month 2 0, 0, 31
1 February February Month 2 1, 0, 29
2 March March Month 2 1, 0, 31
3 Qtr2 Quarter 2 Quarter 1 0, 0, 3
4 Qtr3 Quarter 3 Quarter 1 1, 0, 3
5 October October Month 2 0, 0, 31
6 November November Month 2 1, 0, 30
7 December December Month 2 1, 0, 31

Note   In this example, it is assumed that the members of the SalesRep and Geography dimensions need to be qualified and that members from all other dimensions need not be qualified (to ensure uniqueness). It is also assumed that all level names are unique without qualification.