Cell Element (MDDataSet) (XMLA)


Applies To: SQL Server 2016 Preview

Contains information about a single cell contained by a parent CellData element.

   <Cell CellOrdinal="unsignedInt">  
      <!-- Zero or more cell property values -->  
      <!-- or -->  

Data type and lengthNone
Default valueNone
Cardinality0-n: Optional element that can occur more than once.
Parent elementsCellData
Child elementsZero or more cell property values or Error
CellOrdinalRequired unsignedInt attribute. The ordinal position of the cell within the multidimensional dataset.

In the parent root element, the Axes element is followed by the CellData element, a collection of Cell elements that contain the property values for each cell returned in the multidimensional dataset. The Cell element contains the CellOrdinal attribute, which indicates the zero-based ordinal position of the cell within the multidimensional dataset, and one element for each cell property value associated with the cell. Each cell property value in the Cell element is defined by a separate XML element. The value of the cell property is the data contained by the XML element, and the name of the cell property, as defined in the CellInfo element of the parent root element, corresponds to the name of the XML element.

The following syntax describes a cell property value:

<CellProperty xsi:type="string">value</CellProperty>  

The data type of a cell property value is specified only for the VALUE cell property. The data types of other cell properties are determined by the cell property definition included in the CellInfo element. A cell property value element can be excluded if a default value has been specified (by including a Default element for a cell property definition contained in the CellInfo element) for a cell property, or if no default value has been specified and the value of the cell property is null.

If a cell property cannot be returned due to an error that occurs on the instance of Microsoft SQL Server Analysis Services, such as a calculation error that prevents the value from being returned for a given cell, an Error element replaces the contents of the cell property in question. The following XML example describes a cell property error:

<Cell CellOrdinal="0">  
   <Value xsi:type="xsd:double">  
         <Description>Unknown error</Description>  

The axis reference for a cell can be calculated based on a CellOrdinal attribute value. 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.

Suppose that a query requests four measures on columns and a crossjoin of two states with four quarters on rows. In following the dataset result, the CellOrdinal property for the part of the dataset result shown in bold text is the set {9, 10, 11, 13, 14, 15, 17, 18, 19}. This is the set because the cells are numbered in row-major order, starting with a CellOrdinal of 0 for the upper left cell.

StateQuarterUnit salesStore costStore salesSales count

Applying the formula shown in the figure, axis k = 0 has Uk = 4 members, and axis k = 1 has Uk = 8 tuples. P = 2 is the total number of axes in the query. Taking the cell that is {California, Q3, Store Cost} as S0, 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) times 4 (the value of Ei computed as 1 * 4), or 8. The sum of 1 + 8 is then 9, the cell ordinal for that cell.

The following example demonstrates the structure of the Cell element, including the VALUE, FORMATTED_VALUE, and FORMAT_STRING cell property values for each cell.

   <Cell CellOrdinal="0">  
      <Value xsi:type="xsd:double">16890</Value>  
   <Cell CellOrdinal="1">  
      <Value xsi:type="xsd:int">50</Value>  
   <Cell CellOrdinal="2">  
      <Value xsi:type="xsd:double">36175.2</Value>  

MDDataSet Data Type (XMLA)
Properties (XMLA)

Community Additions