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 extracted. 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" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "STD_CUBE", "n" : "Cube", "k" : "5857",
"c" : "1281", "p" : "5845", "h" : "0" } }, "dirty" : "0", "supportsRub" : "0" }, "matrix" : {
"cells" : { "d" : [ { "v" : { "@v" : "1.000000", "@dt" : "3" },
"c" : { "e" : [ { "@e" : "1", "@dt" : "2" }, { "@e" : "QUARTERS:1.2000",
"@dt" : "1" }, { "@e" : "1", "@dt" : "2" }, { "@e" : "2", "@dt" : "2" }
] } }, { "v" : { "@v" : "5.000000", "@dt" : "3" }, "c" :
{ "e" : [ { "@e" : "1", "@dt" : "2" }, { "@e" : "QUARTERS:1.2000", "@dt" : "1"
}, { "@e" : "4", "@dt" : "2" }, { "@e" : "2", "@dt" : "2" } ]
} }, { "v" : { "@v" : "2.000000", "@dt" : "3" }, "c" : {
"e" : [ { "@e" : "1", "@dt" : "2" }, { "@e" : "QUARTERS:2.2000", "@dt" : "1" },
{ "@e" : "1", "@dt" : "2" }, { "@e" : "2", "@dt" : "2" } ] }
}, { "v" : { "@v" : "6.000000", "@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.000000", "@dt" : "3" }, "c" : { "e" : [
{ "@e" : "1", "@dt" : "2" }, { "@e" : "QUARTERS:3.2000", "@dt" : "1" }, { "@e" : "1",
"@dt" : "2" }, { "@e" : "2", "@dt" : "2" } ] } }, {
"v" : { "@v" : "7.000000", "@dt" : "3" }, "c" : { "e" : [ {
"@e" : "1", "@dt" : "2" }, { "@e" : "QUARTERS:3.2000", "@dt" : "1" }, { "@e" : "4", "@dt" : "2"
}, { "@e" : "2", "@dt" : "2" } ] } }, { "v" :
{ "@v" : "4.000000", "@dt" : "3" }, "c" : { "e" : [ { "@e" : "1",
"@dt" : "2" }, { "@e" : "QUARTERS:4.2000", "@dt" : "1" }, { "@e" : "1", "@dt" : "2" },
{ "@e" : "2", "@dt" : "2" } ] } }, { "v" : {
"@v" : "8.000000", "@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 data matrix var result = somClient.GetCube(tMeta); return result; }
See also: