Getting Availability of Calculation Results

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetWbkMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tWbk xmlns="">
  <id>S1!M!S!W7</id>
  </tWbk>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <useGridAutoAdjust>true</useGridAutoAdjust>
<results>
  <correlation>true</correlation>
  <coefficients>true</coefficients>
  <weights>true</weights>
  <tabSheet>false</tabSheet>
  </results>
  </pattern>
  </tArg>
  </GetWbkMd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetWbkMdResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!W7</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="2" hf="0">
  <i>WBK_CALC</i>
  <n>Calculated series</n>
  <k>5541</k>
  <c>2827</c>
  <p>5471</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>1</dirty>
  <windowsPosition>Vertical</windowsPosition>
  <hasPivot>0</hasPivot>
  <hasLaner>1</hasLaner>
<series count="4">
  <its />
  </series>
<results>
<its>
<it>
  <k>2</k>
  <id>OBJ2</id>
  <n>USA|A</n>
  <vis>1</vis>
  <correlation>0</correlation>
  <coefficients>0</coefficients>
  <weights>0</weights>
  </it>
<it>
  <k>13</k>
  <id>OBJ13</id>
  <n>Geometric trend(France|A)</n>
  <vis>1</vis>
  <correlation>0</correlation>
  <coefficients>1</coefficients>
  <weights>0</weights>
  </it>
  </its>
  </results>
  </meta>
  </GetWbkMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetWbkMd" :
{
"tWbk" :
{
"id" : "S1!M!S!W7"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"useGridAutoAdjust" : "true",
"results" :
{
"correlation" : "true",
"coefficients" : "true",
"weights" : "true",
"tabSheet" : "false"
}
}
}
}
}

JSON response:

{
"GetWbkMdResult" :
{
"id" :
{
"id" : "S1!M!S!W7"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "WBK_CALC",
"n" : "Calculated series",
"k" : "5541",
"c" : "2827",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "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"
}
]
}
}
}
}
}
public static GetWbkMdResult GetWbkResults(WbkId wbk)
{// Set operation execution parameters
var tOp = new GetWbkMd
{
tWbk = wbk,
tArg = new GetWbkMdArg
{// Set pattern for getting data
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("Row: " + it.n);
Console.WriteLine("".PadRight(3) + "- coefficients available: " + it.coefficients);
Console.WriteLine("".PadRight(3) + "- correlation matrix available: " + it.correlation);
Console.WriteLine("".PadRight(3) + "- weights available: " + it.weights);
Console.WriteLine("");
}
return gRes;
}

See also:

Working with Time Series Database