Below is the example of using the GetCube operation to get a table that contains cube data. The request contains moniker of opened cube instance, dimension selection, and parameters of dimensions layout. The response contains a data table. Information on the column and number of rows as well as cell values is available for the table. The cells are shown as a single-dimensional array from left to right and from top to bottom.
{ "GetCube" : { "tCube" : { "id" : "S1!M!S!C1" }, "tArg" : {
"data" : { "cells" : "true", "emptyCells" : "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" } } ] }, "dims" : {
"its" : { "it" : [ { "k" : "5858", "id" : "FACTS", "position" : "Fixed" }, {
"k" : "112", "id" : "CALENDAR", "position" : "Left" }, { "k" : "116", "id" : "DIM_1", "position" : "Top" }, {
"k" : "991", "id" : "DIM_2", "position" : "Top" } ] } } } } } }
{ "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" }, "data" : { "@rowCount" : "4", "@columnCount" : "12",
"cells" : { "c" : [ { "@v" : "", "@dt" : "0" }, { "@v" : "1.000000",
"@dt" : "3" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "5.000000", "@dt" : "3" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "2.000000", "@dt" : "3" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "6.000000", "@dt" : "3" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "3.000000", "@dt" : "3" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "7.000000", "@dt" : "3" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "4.000000", "@dt" : "3" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "",
"@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" },
{ "@v" : "", "@dt" : "0" }, { "@v" : "", "@dt" : "0" }, { "@v" : "8.000000",
"@dt" : "3" }, { "@v" : "", "@dt" : "0" } ] } } } }
public static GetCubeResult GetCubeDataTable(CubeId moniker, Listsels, PvtDims dimsPosition) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tGet = new GetCube() { tArg = new GetCubeArg() { data = new GetCubeDataArg() { selection = sels.ToArray(), dims = dimsPosition, cells = true, emptyCells = true } }, tCube = moniker }; //Obtaining table with data var result = somClient.GetCube(tGet); return result; }
tArg = new GetCubeArg() { data = new GetCubeDataArg() { selection = sels.ToArray(), dims = dimsPosition,
cells = true, emptyCells = true } }, tCube = moniker }; //Get data table var result = somClient.GetCube(tGet); return result; }
See also: