The definition of the hypercube is the following:
"qHyperCubeDef": {
"qDimensions": [
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"CategoryName"
],
"qFieldLabels": [
""
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qSortByAscii": 1
}
],
"qReverseSort": false
}
},
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
""
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qSortByAscii": 1
}
],
"qReverseSort": false
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qDef": {
"qLabel": "",
"qDef": "Sum(OrderTotal)"
}
}
],
"qMode": "EQ_DATA_MODE_PIVOT_STACK",
"qAlwaysFullyExpanded": true,
"qSuppressZero": true,
"qSuppressMissing": true,
"qNoOfLeftDims": -1,
"qInterColumnSortOrder": [],
"qSortPivotByYValue": []
}
Regarding the above definition, the hypercube has the following properties:
- Is handled as a stacked table ("qMode": "EQ_DATA_MODE_PIVOT_STACK")
- The cells are always fully expanded ("qAlwaysFullyExpanded": true).
- CategoryName and ProductName are left dimensions ("qNoOfLeftDims": -1).
- There is one measure Sum(OrderTotal).
The hypercube contains the following data, as shown in the representation below:
The data structure under Beverages is not shown in the above representation since the data inside Beverages are of no interest in this example. Beverages is the first category in the hypercube and Condiments is the category just after.
1. Select the product Grandma's Boysenberry Spread.
Grandma's Boysenberry Spread is a left dimension cell, located at the 13th row (The category Beverages contains 12 products) and second column (qCol is 1). The handle of the request is 2 because the hypercube has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "SelectPivotCells",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qType": "L",
"qRow": 13,
"qCol": 1
}
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The product Grandma's Boysenberry Spread is selected.
2. Retrieve the values related to the product Grandma's Boysenberry Spread.
The paging is composed of the first 10 lines (qHeight is 10) from the top (qTop is 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "GetHyperCubeStackData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 10,
"qWidth": 3
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qDataPages": [
{
"qData": [
{
"qElemNo": 0,
"qValue": 0,
"qType": "R",
"qMaxPos": 804151.33999999682,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 0,
"qSubNodes": [
{
"qText": "Condiments",
"qElemNo": 1,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 804151.33999999682,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 0,
"qSubNodes": [
{
"qText": "\"Grandma's Boysenberry Spread\"",
"qElemNo": 4,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 804151.33999999682,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 0,
"qSubNodes": [
{
"qText": "804151,34",
"qElemNo": 0,
"qValue": 804151.33999999682,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 0,
"qSubNodes": []
}
]
}
]
}
]
}
]
}
]
}
}
qData returns the calculated data related to the product Grandma's Boysenberry Spread. There is only one value (qType is V) since there is only one measure Sum(OrderTotal). Condiments and Grandma's Boysenberry Spread have N as a type because they are left dimension cells.