Reading the cells of a data area

The cells to be read can be specified by a data area as well. It requires that the data area is defined before the Read request. This can be done as a part of the same document or an earlier one. See the "Cube DataareaDefine" topic for the details on the usage of that request.
<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="001" Class="Cube" Method="DataareaDefine">
    <Alea:DataArea Cube="Sales" NonExistentCellSuppression="false" UseOnlyBasicElements="false" TreatZeroAsEmptyCell="false">
      <Alea:DimFilter Dimension="Profit">
        <Alea:Element Name="Sales Volume" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Time" Hierarchy="Time">
        <Alea:Element Name="2016" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Version">
        <Alea:BaseElements />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="CURRTYPE">
        <Alea:Element Name="LC" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Level">
        <Alea:Element Name="IFRS" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Unit">
        <Alea:Element Name="G0000" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Interco">
        <Alea:Element Name="TotalPartner" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Product">
        <Alea:Element Name="AS600/185" />
        <Alea:Element Name="AS600/175" />
      </Alea:DimFilter>
    </Alea:DataArea>
  </Alea:Request>

  <Alea:Request RequestID="002" Class="Cube" Method="Read">
    <Alea:DataQuery FirstBatch="true" CellType="false" Value="true" Note="false" QuotedStrings="false" EscapedStrings="false" DecimalPoint="," WithHierarchies="false" Delimiter=" ">
      <Alea:DataArea Cube="Sales" NonExistentCellSuppression="false" UseOnlyBasicElements="false" TreatZeroAsEmptyCell="false" />
    </Alea:DataQuery>
  </Alea:Request>

</Alea:Document>

Answer

The answer to the request above contains two parts, the answer to the DataareaDefine request (001) and the answer to the Read request (002).

 <Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="001">
    <Alea:Return />
  </Alea:Request>
  <Alea:Request RequestID="002">
    <Alea:Return>
      <Alea:CellBatch LinesCount="16" LastBatch="true">
        2016 Actual LC IFRS G0000 TotalPartner AS600/175 Sales Volume 481114,041375
        2016 Actual LC IFRS G0000 TotalPartner AS600/185 Sales Volume 995134,545879
        2016 Budget LC IFRS G0000 TotalPartner AS600/175 Sales Volume 55055810,226002
        2016 Budget LC IFRS G0000 TotalPartner AS600/185 Sales Volume 90099468,22684
        2016 Forecast LC IFRS G0000 TotalPartner AS600/175 Sales Volume 1232933,095912
        2016 Forecast LC IFRS G0000 TotalPartner AS600/185 Sales Volume 2019456,97731
        2016 Forecast 1 LC IFRS G0000 TotalPartner AS600/175 Sales Volume #N/A
        2016 Forecast 1 LC IFRS G0000 TotalPartner AS600/185 Sales Volume #N/A
        2016 Forecast 2 LC IFRS G0000 TotalPartner AS600/175 Sales Volume #N/A
        2016 Forecast 2 LC IFRS G0000 TotalPartner AS600/185 Sales Volume #N/A
        2016 Forecast 3 LC IFRS G0000 TotalPartner AS600/175 Sales Volume #N/A
        2016 Forecast 3 LC IFRS G0000 TotalPartner AS600/185 Sales Volume #N/A
        2016 Simulation LC IFRS G0000 TotalPartner AS600/175 Sales Volume #N/A
        2016 Simulation LC IFRS G0000 TotalPartner AS600/185 Sales Volume #N/A
        2016 - LC IFRS G0000 TotalPartner AS600/175 Sales Volume #N/A
        2016 - LC IFRS G0000 TotalPartner AS600/185 Sales Volume #N/A
      </Alea:CellBatch>
    </Alea:Return>
  </Alea:Request>
</Alea:Document>

Additional values are available on the server as indicated by the LastBatch="false" attribute in the CellBatch tag.

You can request hierarchy information by adding WithHierarchies="true" to the DataQuery element. The server signals the presence of hierarchy information in the result. It can also be triggered by using non-default hierarchies in the data area definition by applying the same attribute to the CellBatch element in the result.

The NonExistentCellSuppression XML attribute can be True or False. It specifies if empty cells are included in the respective query. A special case is that a string cell can contain an empty string. That is not the same as an empty cell. Specifying this XML attribute for Cube.Read overrides any previous one specified in Cube DataareaDefine.

<Alea:DataQuery FirstBatch="true" DecimalPoint="." Value="true" Note="false" QuotedStrings="false" WithHierarchies="true">

You can request cell type information by using the CellType attribute. The CellType attribute was added in the 10.6 release. The CellType attribute is optional. The default value is false. If set to true, the cell type is returned in the response. The cell type must be requested specifically from the client. This adds a column to the result set of Cube Read defined for the data area that contains the cell type information. The possible values are:

  • 'M' - Missing value followed by '#NA' as a cell value.
  • 'N' - Numeric value followed by cell value.
  • 'S' - String value followed by string value.
  • 'E' - Error followed by '#Error' as a cell value.

The boolean Value attribute specifies if the cell value will be returned after the coordinates. It is optional and the default value is true.

The boolean Note attribute specifies if the cell note will be returned after the coordinates. It is optional and the default value is false.

If neither cell values nor cell notes are requested, the cell values will be returned. If both cell values and cell notes are requested, the OLAP Database Worker will return the cell values only. If Value is missing and Note is set to True, then only the cell note is returned.

This example shows combined Cube DataAreaDefine and Cube Read functions requesting the cell value and cell type information:

<Alea:Document xmlns:Alea="http://www.misag.com">
  <Alea:Request RequestID="001" Class="Cube" Method="DataareaDefine">
    <Alea:DataArea Cube="Sales" NonExistentCellSuppression="false" UseOnlyBasicElements="false" >
      <Alea:DimFilter Dimension="Profit">
        <Alea:Element Name="Sales Volume" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Time" Hierarchy="Time">
        <Alea:Element Name="2016" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Version">
        <Alea:BaseElements />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="CURRTYPE">
        <Alea:Element Name="LC" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Level">
        <Alea:Element Name="IFRS" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Unit">
        <Alea:Element Name="G0000" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Interco">
        <Alea:Element Name="TotalPartner" />
      </Alea:DimFilter>
      <Alea:DimFilter Dimension="Product">
        <Alea:Element Name="AS600/185" />
        <Alea:Element Name="AS600/175" />
      </Alea:DimFilter>
    </Alea:DataArea>
  </Alea:Request>

  <Alea:Request RequestID="002" Class="Cube" Method="Read">
    <Alea:DataQuery FirstBatch="true" CellType="true" Value="true" Note="false" >
      <Alea:DataArea Cube="Sales" NonExistentCellSuppression="false" UseOnlyBasicElements="false" />
    </Alea:DataQuery>
  </Alea:Request>

</Alea:Document>