Partager via


2.2.4.1.1.3.1.2 CellOrdinal Attribute

The CellOrdinal attribute MUST be specified and indicates the ordinal of the cell. CellOrdinal is numbered 0 to n-1, for n cells.

The axis reference for a cell can be calculated based on CellOrdinal. Conceptually, cells are numbered in a dataset as if the dataset were a p-dimensional array, where p is the number of axes. Cells are addressed in row-major order. The following illustration shows the formula for calculating the ordinal number of a cell.

Calculating ordinal number of a cell

Figure 4: Calculating ordinal number of a cell

The preceding formula will be applied to the result set shown in the following table. The query asked for four measures on columns and a crossjoin of two states with four quarters on rows. In the following dataset result, the CellOrdinal property for the part of the dataset result shown in the box is the set {9, 10, 11, 13, 14, 15, 17, 18, 19}. This is because the cells are numbered in row-major order, starting with a CellOrdinal of zero for the upper left cell.

Next, the preceding formula is applied to the cell that is {CA, Q3, Store Cost}. Axis k=0 has Uk=4 members and axis k=1 has Uk=8 tuples. P is the total number of axes in the query, here equal to 2. So, the initial summation is i=0 to 1. For i=0, the tuple ordinal on axis 0 of {Store Cost} is 1. For i = 1, the tuple ordinal of {CA, Q3} is 2.

For i=0, Ei = 1, so for i = 0 the sum is 1 * 1 = 1 and for i=1, the sum is 2 (tuple ordinal) * 4 (the value of Ei, computed as 1 * 4), or 8, and so the sum is equal to 1 + 8 = 9, the cell ordinal for that cell.

Location

Quarter

Unit Sales

Store Cost

Store Sales

Sales Count

CA

Q1

16,890.00

14,431.09

$36,175.20

5498

Q2

18,052.00

15,332.02

$38,396.75

5915

Q3

18,370.00

15,672.83

$39,394.05

6014

Q4

21,436.00

18,094.50

$45,201.84

7015

OR

Q1

19,287.00

16,081.07

$40,170.29

6184

Q2

15,079.00

12,678.96

$31,772.88

4799

Q3

16,940.00

14,273.78

$35,880.46

5432

Q4

16,353.00

13,738.68

$34,453.44

5196