Below is the example of using the GetWbkMd operation to get whether the calculation results for workbook series are available. The request contains an instance of opened workbook and a pattern for getting data. The response returns whether calculation results are available.
{ "GetWbkMd" : { "tWbk" : { "id" : "S1!M!S!W5" }, "tArg" : { "pattern" : { "obInst" : "true",
"results" : { "correlation" : "true", "coefficients" : "true", "weights" : "true", "tabSheet" : "false" } } } } }
{ "GetWbkMdResult" : { "id" : { "id" : "S1!M!S!W5" }, "meta" : { "obInst" : {
"obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "WBK_CALC", "n" : "Calculated series", "k" : "5541", "c" : "2827", "p" : "5471", "h" : "0"
} }, "dirty" : "1", "windowsPosition" : "Vertical", "hasPivot" : "0", "hasLaner" : "1", "series" : { "@count" : "4", "its" : ""
}, "results" : { "its" : { "it" : [ { "k" : "2", "id" : "OBJ2",
"n" : "USA|A", "vis" : "1", "correlation" : "0", "coefficients" : "0", "weights" : "0" }, { "k" : "13", "id" : "OBJ13", "n" : "Geometric trend(France|A)",
"vis" : "1", "correlation" : "0", "coefficients" : "1", "weights" : "0" } ] } } } } }
The GetWbkResults function gets whether the calculation results for workbook series are available. Input parameters:
wbk. Workbook instance.
After execution the function returns a result of data extraction. The console window displays information about results availability.
public static GetWbkMdResult GetWbkResults(WbkId wbk) {// Set operation execution parameters var tOp = new GetWbkMd { tWbk = wbk, tArg = new GetWbkMdArg {// Set data extraction pattern pattern = new WbkMdPattern { results = new LnResultsPattern() { coefficients = true, correlation = true, weights = true, tabSheet = false, series = null } } } }; // Create proxy object for operation execution var somClient = new SomPortTypeClient(); // Execute operation var gRes = somClient.GetWbkMd(tOp); LnResults res = gRes.meta.results; foreach (LnResult it in res.its) { Console.WriteLine("Series: " + it.n); Console.WriteLine("".PadRight(3) + "- coefficients are available: " + it.coefficients); Console.WriteLine("".PadRight(3) + "- correlation matrix is available: " + it.correlation); Console.WriteLine("".PadRight(3) + "- weights are available: " + it.weights); Console.WriteLine(""); } return gRes; }
See also:
Working with Time Series Database