Below is the example of using the GetCube operation to get a matrix that contains cube data. The request contains moniker of opened cube instance moniker and the dimension selection, according to which the data is obtained. The response contains a matrix with data cells. For each cell there will be available information on the cube coordinate and the value. Only the cells that contain some values are retrieved on operation execution. The cells that contain empty values are skipped.
{
"GetCube" :
{
"tCube" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"matrix" :
{
"cells" : "true",
"selection" :
{
"it" :
[
{
"k" : "5858",
"id" : "FACTS",
"sel" :
{
"elSelectOp" : "Select",
"elRelative" : "All"
}
},
{
"k" : "112",
"id" : "CALENDAR",
"sel" :
{
"elSelectOp" : "Unknown",
"elRelative" : "Unknown",
"setCalendarPeriod" :
{
"active" : "true",
"start" : "2000-01-01",
"end" : "2000-12-01",
"levels" :
{
"it" : "Quarter"
},
"append" : "false",
"findOutActive" : "false"
}
}
},
{
"k" : "116",
"id" : "DIM_1",
"sel" :
{
"elSelectOp" : "Select",
"elRelative" : "All"
}
},
{
"k" : "991",
"id" : "DIM_2",
"sel" :
{
"elSelectOp" : "Select",
"elRelative" : "All"
}
}
]
},
"useCache" : "true"
}
}
}
}
{
"GetCubeResult" :
{
"id" :
{
"id" : "S1!M!S!C1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "31",
"@hf" : "0",
"i" : "STD_CUBE",
"n" : "Cube",
"k" : "5857",
"c" : "1281",
"p" : "5845",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"supportsRub" : "0"
},
"matrix" :
{
"cells" :
{
"d" :
[
{
"v" :
{
"@v" : "44",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:1.2000",
"@dt" : "1"
},
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "4",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:1.2000",
"@dt" : "1"
},
{
"@e" : "2",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "23",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:1.2000",
"@dt" : "1"
},
{
"@e" : "3",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "45",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:1.2000",
"@dt" : "1"
},
{
"@e" : "4",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "5",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:1.2000",
"@dt" : "1"
},
{
"@e" : "5",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "88",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:2.2000",
"@dt" : "1"
},
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "8",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:2.2000",
"@dt" : "1"
},
{
"@e" : "2",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "56",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:2.2000",
"@dt" : "1"
},
{
"@e" : "3",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "45",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:2.2000",
"@dt" : "1"
},
{
"@e" : "4",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "3",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:2.2000",
"@dt" : "1"
},
{
"@e" : "5",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "132",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:3.2000",
"@dt" : "1"
},
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "9",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:3.2000",
"@dt" : "1"
},
{
"@e" : "2",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "54",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:3.2000",
"@dt" : "1"
},
{
"@e" : "3",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "65",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:3.2000",
"@dt" : "1"
},
{
"@e" : "4",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "195",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:4.2000",
"@dt" : "1"
},
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "10",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:4.2000",
"@dt" : "1"
},
{
"@e" : "2",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "54",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:4.2000",
"@dt" : "1"
},
{
"@e" : "3",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
},
{
"v" :
{
"@v" : "43",
"@dt" : "3"
},
"c" :
{
"e" :
[
{
"@e" : "1",
"@dt" : "2"
},
{
"@e" : "QUARTERS:4.2000",
"@dt" : "1"
},
{
"@e" : "4",
"@dt" : "2"
},
{
"@e" : "2",
"@dt" : "2"
}
]
}
}
]
}
}
}
}
public static GetCubeResult GetCubeMatrix(CubeId moniker, Listsels)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tMeta = new GetCube()
{
tArg = new GetCubeArg()
{
matrix = new GetCubeMatrixArg()
{
selection = sels.ToArray(),
cells = true
}
},
tCube = moniker
};
//Get matrix with data
var result = somClient.GetCube(tMeta);
return result;
}
See also: