Finding Slicer Information

Every dimension in the cube has to be either an axis dimension or a slicer dimension. The method for finding information about dimension members that are on an axis was described in the previous sections. For the purposes of returning slicer dimension information, the set of slicer dimensions is treated as if they were on a special axis, called the slicer axis. For the purposes of axis ordering, the slicer axis is assumed to come after all other axes. The identifier for the slicer axis is MDAXIS_SLICERS, and is defined to be the constant 0xffffffff, the largest ULONG (32-bit) value possible.

As it does for any other axis, the MDAXISINFO structure returns information about the slicer axis as well. The cDimensions field contains the number of slicer dimensions; cCoordinates is 1 for most providers since the slicer for most providers is just one tuple. The rgpwszDimensionNames value points to the array containing the names of all slicer dimensions, and rgcColumns points to the array containing the number of columns corresponding to each slicer dimension, on the axis rowset. The axis rowset for the slicer dimension usually has just one row since most providers support only one tuple for a slicer.

The slicer axis rowset for the example dataset in Chapter 2, “Cube and Dataset Example,” is shown below. Since there are 16 columns in this rowset, and all will not fit on the same page, only the MEMBER_UNIQUE_NAME and LEVEL_UNIQUE_NAME columns are shown for each dimension.




TUPLE_
ORDI-
NAL
[MEAS-
URES].
[MEM-
BER_
UNIQUE_
NAME]

[MEAS-
URES].
[LEVEL_
UNIQUE_
NAME]

[YEARS].
[MEM-
BER_
UNIQUE_
NAME]


[YEARS].
[LEVEL_
UNIQUE_
NAME]
[PRO-
DUCTS].
[MEM-
BER_
UNIQUE_
NAME]

[PRO-
DUCTS].
[LEVEL_
UNIQUE_
NAME]
0 Sales Measures [1991] Years [Products].
[All]
[Products].
[All]

Note   MEASURES_LEVEL is just “Measures,” the name of the dimension itself. This is because, in the example, there was no hierarchy in this dimension, so the level name was a dummy name made up by the provider. It used the name of the dimension itself to create the dummy name. By a similar reasoning, the name of the YEARS_LEVEL is “Years.” Also, it is assumed that “Sales” and “[1991]” are unique and therefore do not need to be qualified.

The columns for each slicer dimension are available in the order that these dimensions are listed in the rgpwszDimensionNames array. This order is not necessarily the same as the order of dimensions as inferred from the members constituting the slicer tuple. For example, if the slicer tuple is ([Measures].[Sales], [Years].[1991], [Products].[All]), and rgpwszDimensionNames is [Years, Measures, Products], then the columns for Years dimension come first, followed by those for Measures and Products. Consumers should not derive column order from the slicer tuple; rather, they should derive it from the dimension name array of MDAXISINFO.