Execute MDX Report
/applications/{applicationName}/databases/{databaseName}/grid/mdx
Returns an output grid from the specified MDX report.
Request
-
applicationName(required):
Application name for grid.
-
databaseName(required):
Database/Cube name for grid.
Response
200 Response
OK
Grid returned successfully.
400 Response
Bad Request
Validation failed. The application, database, or MDX report name may be missing or incorrect.
500 Response
Internal Server Error.
Examples
The following example shows how to output an Essbase grid from an MDX query.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat.
Script with cURL Command
call properties.bat
curl -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/SampleG/databases/Basic/grid/mdx -H "Accept:application/json" -H "Content-Type:application/json" --data "@./gridexecutemdx.json" -o out_gridexecutemdx.json -u %User%:%Password%Input JSON with MDX Query
The execute MDX report operation requires a query object with a valid MDX query as its string value. The input MDX query object is in gridexecutemdx.json, which looks like:
{
"query": "select { Product } on rows, { Market } on columns from Sample.Basic"
}Response Grid
The resulting response grid is:
| - | Market |
|---|---|
| Product | 105522 |
{
"alias" : "Default",
"dimensions" : [ {
"name" : "Market",
"row" : 0,
"column" : -1,
"pov" : "",
"hidden" : false,
"expanded" : false
}, {
"name" : "Product",
"row" : -1,
"column" : 0,
"pov" : "",
"hidden" : false,
"expanded" : false
}, {
"name" : "Year",
"row" : -1,
"column" : -1,
"pov" : "Year",
"hidden" : false,
"expanded" : false
}, {
"name" : "Measures",
"row" : -1,
"column" : -1,
"pov" : "Measures",
"hidden" : false,
"expanded" : false
}, {
"name" : "Scenario",
"row" : -1,
"column" : -1,
"pov" : "Scenario",
"hidden" : false,
"expanded" : false
} ],
"slice" : {
"columns" : 2,
"rows" : 2,
"data" : {
"ranges" : [ {
"start" : 0,
"end" : 3,
"values" : [ "", "Market", "Product", "105522.0" ],
"types" : [ "7", "0", "0", "2" ],
"texts" : [ null, null, null, null ],
"dataFormats" : [ ],
"statuses" : [ "0", "0", "0", "1" ],
"filters" : [ "", "", "", "" ],
"enumIds" : [ "", "", "", "" ]
} ]
}
}
}The alias table used in the grid is named Default. Each dimension of the cube is listed in the dimensions object. The slice object describes the number of columns and rows, and the position, values, and types of data cells. Data cell types are 0 for text, 2 for doubles, and 7 for empty.