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 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 it. After Condiments, exist six more categories that are not displayed in the above representation.
1. Get the values of the stacked table.
In this example, the handle of the stacked table is 2 and the paging is composed of the first line (qHeight is 1) starting from the second line from the top (qTop is 1). Parameters qLeft and qWidth are not used.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "GetHyperCubeStackData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 1,
"qLeft": 0,
"qHeight": 1,
"qWidth": 3
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qDataPages": [
{
"qData": [
{
"qElemNo": 0,
"qValue": 0,
"qType": "R",
"qMaxPos": 215030477.16319153,
"qMinNeg": 0,
"qUp": 1,
"qDown": 6,
"qRow": 0,
"qSubNodes": [
{
"qText": "Condiments",
"qElemNo": 1,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 13190686.128732003,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 12,
"qSubNodes": [
{
"qText": "\"Chef Anton's Cajun Seasoning\"",
"qElemNo": 3,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 626291.832,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 12,
"qSubNodes": [
{
"qText": "626291,832",
"qElemNo": 0,
"qValue": 626291.832,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 12,
"qSubNodes": []
}
]
},
{
"qText": "\"Grandma's Boysenberry Spread\"",
"qElemNo": 4,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 804151.33999999682,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 13,
"qSubNodes": [
{
"qText": "804151,34",
"qElemNo": 0,
"qValue": 804151.33999999682,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 13,
"qSubNodes": []
}
]
},
{
"qText": "\"Sirop d'érable\"",
"qElemNo": 57,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 519496.14800000016,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 14,
"qSubNodes": [
{
"qText": "519496,148",
"qElemNo": 0,
"qValue": 519496.14800000016,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 14,
"qSubNodes": []
}
]
},
{
"qText": "Aniseed Syrup",
"qElemNo": 2,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 942129.56899999967,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 15,
"qSubNodes": [
{
"qText": "942129,569",
"qElemNo": 0,
"qValue": 942129.56899999967,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 15,
"qSubNodes": []
}
]
},
{
"qText": "Genen Shouyu",
"qElemNo": 13,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 1082838.1234999998,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 16,
"qSubNodes": [
{
"qText": "1082838,1235",
"qElemNo": 0,
"qValue": 1082838.1234999998,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 16,
"qSubNodes": []
}
]
},
{
"qText": "Gula Malacca",
"qElemNo": 42,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 1497544.0762320019,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 17,
"qSubNodes": [
{
"qText": "1497544,076232",
"qElemNo": 0,
"qValue": 1497544.0762320019,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 17,
"qSubNodes": []
}
]
},
{
"qText": "Louisiana Fiery Hot Pepper Sauce",
"qElemNo": 61,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 1076838.487999998,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 18,
"qSubNodes": [
{
"qText": "1076838,488",
"qElemNo": 0,
"qValue": 1076838.487999998,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 18,
"qSubNodes": []
}
]
},
{
"qText": "Northwoods Cranberry Sauce",
"qElemNo": 6,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 2662262.4300000011,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 19,
"qSubNodes": [
{
"qText": "2662262,43",
"qElemNo": 0,
"qValue": 2662262.4300000011,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 19,
"qSubNodes": []
}
]
},
{
"qText": "Original Frankfurter grüne Soße",
"qElemNo": 72,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 3194776.8350000028,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 20,
"qSubNodes": [
{
"qText": "3194776,835",
"qElemNo": 0,
"qValue": 3194776.8350000028,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 20,
"qSubNodes": []
}
]
},
{
"qText": "Vegie-spread",
"qElemNo": 59,
"qValue": "NaN",
"qType": "N",
"qMaxPos": 784357.28700000141,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 21,
"qSubNodes": [
{
"qText": "784357,287",
"qElemNo": 0,
"qValue": 784357.28700000141,
"qType": "V",
"qMaxPos": 0,
"qMinNeg": 0,
"qUp": 0,
"qDown": 0,
"qRow": 21,
"qSubNodes": []
}
]
}
]
}
]
}
]
}
]
}
}
qData returns:
- the root node (qType is R)
- the category Condiments
- the list of the products inside the category Condiments
- a calculated value (Sum(OrderTotal)) for each product.
The type (qType) for Condiments and each product inside this category is N since they are dimension values. The type (qType) for the calculated values is V since they are values.
qRow is set to 12 for Condiments since Condiments is located at the 12th row. (The category Beverages contains 12 products).
qMaxPos is set to 13190686.128732003 for the category Condiments since it is the total of all the positive values in the Condiments group (sum of all qMaxPos at product's level).
qMinNeg is set to 0 since there is no negative values in the Condiments group.