Ниже приведен пример использования операции GetCube для получения матрицы с данными куба. В запросе передается моникёр открытого экземпляра куба и отметка по измерениям, в соответствии с которой будут извлекаться данные. В ответе приходит матрица ячеек с данными. Для каждой ячейкой будет присутствовать информация о координате куба и значение. При выполнении операции извлекаются только те ячейки, по которым имеются значения. Ячейки с пустыми значениями пропускаются.
{
"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" : "Куб",
"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(); //Прокси-объект для выполнения операций
//Параметры выполнения операции
var tMeta = new GetCube()
{
tArg = new GetCubeArg()
{
matrix = new GetCubeMatrixArg()
{
selection = sels.ToArray(),
cells = true
}
},
tCube = moniker
};
//Получение матрицы с данными
var result = somClient.GetCube(tMeta);
return result;
}
См. также: