I'm trying to retrieve and render a view using the REST API. I want to present it similarly to how it looks in Architect. Python is not an option in my dev environment -- so I must do so using native API calls via web request.
I've tried using tm1.Execute, but when the Axes are returned, I don't seem the get the "display name" of the tuples in the rows or columns, rather the raw element name:
Code: Select all
api/v1/Cubes('My Cube')/Views('My View')/tm1.Execute?$expand=Axes($expand=Hierarchies($select=Name),Tuples($expand=Members($select=Name))),Cells
Code: Select all
{
"Axes": [
{
"Ordinal": 0,
"Cardinality": 1,
"Hierarchies": [
{
"Name": "Column Dimension"
}
],
"Tuples": [
{
"Ordinal": 0,
"Members": [
{
"Name": "Measure 001"
}
]
}
]
},
{
"Ordinal": 1,
"Cardinality": 33,
"Hierarchies": [
{
"Name": "Row Dimension"
}
],
"Tuples": [
{
"Ordinal": 0,
"Members": [
{
"Name": "Raw Element Name 001"
}
]
},
{
"Ordinal": 1,
"Members": [
{
"Name": "Raw Element Name 002"
}
]
},
...
Code: Select all
{
"Name": "Raw Element Name",
"UniqueName": "[Dimension Name].[Hierarchy Name].[Raw Element Name]",
"Type": "Regular",
"Ordinal": 27,
"IsPlaceholder": false,
"Weight": 1,
"Attributes": {
"Caption": "Raw Element Name",
"Display Name": "THE ATTRIBUTE I WANT"
},
"DisplayInfo": 131072,
"DisplayInfoAbove": 131072
}
So, I tried getting the selected attribute from the NativeView subset data using the following query:
Code: Select all
api/v1/Cubes('My Cube')/Views('My View')?$expand=tm1.NativeView/Rows/Subset($expand=Elements),tm1.NativeView/Columns/Subset($expand=Elements),tm1.NativeView/Titles/Subset($expand=Elements)
Code: Select all
{
"Name": "My View",
"Attributes": {
"Caption": "My View"
},
"Rows": [
{
"Subset": {
"Name": "",
"UniqueName": "",
"Expression": null,
"Attributes": {
"Caption": ""
},
"Elements": [
{
"Name": "Raw Element Name",
"UniqueName": "[Row Dimension].[Row Hierarchy].[Raw Element Name]",
"Type": "Numeric",
"Level": 0,
"Index": 2,
"Attributes": {
"Caption": "Raw Element Name",
"Display Name": "THE ATTRIBUTE I WANT"
}
},
...
If anyone can provide advice on how to get this value, it would be much appreciated.
Cheers,
Harvey.