The definition of the hypercube is the following:
"qHyperCubeDef": {
"qDimensions": [
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"CategoryName"
],
"qFieldLabels": [
""
],
"qSortCriterias": [
{
"qSortByLoadOrder": 0,
"qSortByAscii": 1
}
],
"qReverseSort": false
}
},
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
""
],
"qSortCriterias": [
{
"qSortByLoadOrder": 0,
"qSortByAscii": 1
}
],
"qReverseSort": false
}
},
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"City"
],
"qFieldLabels": [
""
],
"qSortCriterias": [
{
"qSortByLoadOrder": 0,
"qSortByAscii": 1
}
],
"qReverseSort": false
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qDef": {
"qLabel": "",
"qDef": "Sum(OrderTotal)"
}
}
],
"qMode": "EQ_DATA_MODE_PIVOT",
"qAlwaysFullyExpanded": false,
"qSuppressZero": true,
"qSuppressMissing": true,
"qNoOfLeftDims": 1,
"qInterColumnSortOrder": []
}
Regarding the above definition, the hypercube has the following properties:
- Is handled as a pivot table ("qMode": "EQ_DATA_MODE_PIVOT")
- The cells are not always fully expanded ("qAlwaysFullyExpanded": false).
- CategoryName is a left dimension.
- ProductName and City are top dimensions.
- There is one measure: Sum(OrderTotal).
1. Retrieve the data from the pivot table. In this example, the handle of the pivot table is 2 and the paging is composed of the first 3 lines (qHeight) and 3 columns (qWidth) starting from the top left (qTop and qLeft set to 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetHyperCubePivotData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 3
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qDataPages": [
{
"qLeft": [
{
"qText": "Beverages",
"qElemNo": 0,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "Condiments",
"qElemNo": 1,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "Confections",
"qElemNo": 2,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
],
"qTop": [
{
"qText": "\"Chef Anton's Cajun Seasoning\"",
"qElemNo": 3,
"qValue": "NaN",
"qCanExpand": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "\"Grandma's Boysenberry Spread\"",
"qElemNo": 4,
"qValue": "NaN",
"qCanExpand": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "\"Gustaf's Knäckebröd\"",
"qElemNo": 20,
"qValue": "NaN",
"qCanExpand": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
],
"qData": [
[
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
],
[
{
"qText": "626291,832",
"qNum": 626291.832,
"qType": "V"
},
{
"qText": "804151,34",
"qNum": 804151.33999999682,
"qType": "V"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
],
[
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
]
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 3,
"qHeight": 3
}
}
]
}
}
All cells are collapsed (qCanExpand is set to true).
2. Expand the cell Chef Anton's Cajun Seasoning. Chef Anton's Cajun Seasoning is the first product name (qCol is 0). ProductName is the first top dimension (qRow is 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "ExpandTop",
"handle": 2,
"params": [
"/qHyperCubeDef",
0,
0,
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {},
"change": [
2
]
}
The cell Chef Anton's Cajun Seasoningis expanded. The city Cunewalde is displayed.
3. Retrieve the values of the pivot table. In this example, the handle of the pivot table is 2 and the paging is composed of the first 3 lines (qHeight is 3) and 3 columns (qWidth is 3) starting from the top left (qTop and qLeft are 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetHyperCubePivotData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 3
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qDataPages": [
{
"qLeft": [
{
"qText": "Beverages",
"qElemNo": 0,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "Condiments",
"qElemNo": 1,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
},
{
"qText": "Confections",
"qElemNo": 2,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
],
"qTop": [
{
"qText": "\"Chef Anton's Cajun Seasoning\"",
"qElemNo": 3,
"qValue": "NaN",
"qCanCollapse": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": [
{
"qText": "Cunewalde",
"qElemNo": 8,
"qValue": "NaN",
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
]
},
{
"qText": "\"Grandma's Boysenberry Spread\"",
"qElemNo": 4,
"qValue": "NaN",
"qCanExpand": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": [
{
"qElemNo": -4,
"qValue": "NaN",
"qType": "E",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
]
},
{
"qText": "\"Gustaf's Knäckebröd\"",
"qElemNo": 20,
"qValue": "NaN",
"qCanExpand": true,
"qType": "N",
"qUp": 0,
"qDown": 0,
"qSubNodes": [
{
"qElemNo": -4,
"qValue": "NaN",
"qType": "E",
"qUp": 0,
"qDown": 0,
"qSubNodes": []
}
]
}
],
"qData": [
[
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
],
[
{
"qText": "626291,832",
"qNum": 626291.832,
"qType": "V"
},
{
"qText": "804151,34",
"qNum": 804151.33999999962,
"qType": "V"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
],
[
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
},
{
"qText": "-",
"qNum": "NaN",
"qType": "U"
}
]
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 3,
"qHeight": 3
}
}
]
}
}
The product Chef Anton's Cajun Seasoninghas one sub node: Cunewalde.
4. Collapse the cell Chef Anton's Cajun Seasoning.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "CollapseTop",
"handle": 2,
"params": [
"/qHyperCubeDef",
0,
0,
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {},
"change": [
2
]
}
The cell Chef Anton's Cajun Seasoning is collapsed.