Save MDX Report
/essbase/rest/v1/applications/{application}/databases/{database}/queries
Saves an MDX report for the specified cube.
See also:
Request
- application/json
- application/xml
-
application(required): string
Application name.
-
database(required): string
Database name.
Details of query to be saved.
object-
name:
string
-
query:
object Query
-
type:
string
Allowed Values:
[ "MDX", "DATA_SOURCE" ]
object-
aliasTableName:
string
When the memberIdentifierType: ALIAS and the aliasTable are set to a valid alias table name, the resulting mdx grid contains member names from the specified table. If the value of this property is not set then names are picked from the Default alias table.
-
cellAttributes:
boolean
Set to true to enable query result to return a set of metadata attributes besides the actual data value.
-
dataless:
boolean
Set to true to omit data values from the output set. Default is false.
-
formatString:
boolean
Set to true to return the formatted values for cells of type text or date, or cells associated with a format string. Default is true.
-
formatValues:
boolean
Set to true to return the formatted values for cells.
-
hideRestrictedData:
boolean
Set to true to hide the restricted cell data in the output.
-
meaninglessCells:
boolean
Set to true to suppress the meaningless cell data in the output. For example, missing or structurally irrelevant cells.
-
memberIdentifierType:
string
Allowed Values:
[ "NAME", "ALIAS", "UNIQUE_NAME" ]Specify whether metadata in the output should refer to member names, member aliases, or unique member names (in case of duplicate member enabled outlines).
-
textList:
boolean
Set to true to return a comma-separated list of all text values associated with the cell in the output.
-
urlDrillThrough:
boolean
Set to true to add URLs to each applicable cell so users can click through to the source data. This works only if the Essbase drill-through links are configured.
Response
- application/json
- application/xml
200 Response
OK
MDX report saved successfully.
object-
name:
string
-
query:
object Query
-
type:
string
Allowed Values:
[ "MDX", "DATA_SOURCE" ]
object-
aliasTableName:
string
When the memberIdentifierType: ALIAS and the aliasTable are set to a valid alias table name, the resulting mdx grid contains member names from the specified table. If the value of this property is not set then names are picked from the Default alias table.
-
cellAttributes:
boolean
Set to true to enable query result to return a set of metadata attributes besides the actual data value.
-
dataless:
boolean
Set to true to omit data values from the output set. Default is false.
-
formatString:
boolean
Set to true to return the formatted values for cells of type text or date, or cells associated with a format string. Default is true.
-
formatValues:
boolean
Set to true to return the formatted values for cells.
-
hideRestrictedData:
boolean
Set to true to hide the restricted cell data in the output.
-
meaninglessCells:
boolean
Set to true to suppress the meaningless cell data in the output. For example, missing or structurally irrelevant cells.
-
memberIdentifierType:
string
Allowed Values:
[ "NAME", "ALIAS", "UNIQUE_NAME" ]Specify whether metadata in the output should refer to member names, member aliases, or unique member names (in case of duplicate member enabled outlines).
-
textList:
boolean
Set to true to return a comma-separated list of all text values associated with the cell in the output.
-
urlDrillThrough:
boolean
Set to true to add URLs to each applicable cell so users can click through to the source data. This works only if the Essbase drill-through links are configured.
400 Response
Bad Request
Failed to save MDX report.
Examples
The following example shows how to save an MDX report in the context of an Essbase cube.
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/ASOSamp/databases/Basic/queries -H "Accept:application/json" -H "Content-Type:application/json" --data "@./mdxAggregateT1.json" -u %User%:%Password%Sample JSON Payload
The cURL example above delivers the following JSON payload in mdxAggregateT1.json.
{
"name" : "mdxAggregateT1",
"type" : "MDX",
"query" : {
"spec" : "WITH \n SET [T1] AS '{[Time].[1st Half]}'\n SET [GM] AS '{Children ( [Geography].[South] )}'\n MEMBER [Measures].[m1] as 'Aggregate(CrossJoin([T1],{[Geography].CurrentMember}),[Measures].[Price Paid])'\nSELECT \n {[Measures].[m1]} \nON COLUMNS,\n NON EMPTY {CrossJoin([T1] ,[GM])}\nON ROWS\nFROM ASOSamp.Basic"
}
}
Example of Response Body
The following example shows the contents of the response body in JSON format:
{
"name" : "mdxAggregateT1",
"type" : "MDX",
"query" : {
"spec" : "WITH \n SET [T1] AS '{[Time].[1st Half]}'\n SET [GM] AS '{Children ( [Geography].[South] )}'\n MEMBER [Measures].[m1] as 'Aggregate(CrossJoin([T1],{[Geography].CurrentMember}),[Measures].[Price Paid])'\nSELECT \n {[Measures].[m1]} \nON COLUMNS,\n NON EMPTY {CrossJoin([T1] ,[GM])}\nON ROWS\nFROM ASOSamp.Basic"
},
"links" : [ {
"rel" : "self",
"method" : "GET"
}, {
"rel" : "delete",
"method" : "DELETE"
}, {
"rel" : "update",
"method" : "PUT"
}, {
"rel" : "Get data In JSON",
"method" : "GET"
}, {
"rel" : "Get data in HTML",
"href" : "?format=HTML",
"method" : "GET"
}, {
"rel" : "Get data in Excel",
"href" : "?format=XLSX",
"method" : "GET"
}, {
"rel" : "Get data in CSV",
"href" : "?format=CSV",
"method" : "GET"
} ]
}