SemanticLayerSourceAddQuery

Syntax

OpItemKey SemanticLayerSourceAddQuery(string mon)

Parameters

mon. Data model source moniker.

Description

The SemanticLayerSourceAddQuery operation creates an SQL query based on data model source.

Comments

To execute the operation, in the mon field specify moniker of opened data model instance with the !Sources!source key postfix.

The operation results in the key of created query. Further work with SQL query is executed using the DashboardFormulaEditorEdit, DashboardFormulaEditorApply, DashboardFormulaEditorRollback, DashboardFormulaEditorDelete operations.

Example

Below is the example of creating an SQL query in data model. The request contains moniker of opened data model instance and data source key. The response contains key of created SQL query.

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">
<SemanticLayerSourceAddQuery xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">KHBBAIKKHBCDGOAEBJILIDLMBNKIKJJEOLDDGEOMOCFPLAFB!M!S!PCMGALLKKHBCDGOAEAGKHOMPAJPKDLOPEFJJKKEKPJDIGENGH!Sources!1</mon>
  </SemanticLayerSourceAddQuery>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SemanticLayerSourceAddQueryResult 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">
  <k xmlns="">2</k>
  </SemanticLayerSourceAddQueryResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SemanticLayerSourceAddQuery" :
{
"mon" : "KHBBAIKKHBCDGOAEBJILIDLMBNKIKJJEOLDDGEOMOCFPLAFB!M!S!PCMGALLKKHBCDGOAEAGKHOMPAJPKDLOPEFJJKKEKPJDIGENGH!Sources!1"
}
}

JSON response:

{
"SemanticLayerSourceAddQueryResult" :
{
"k" : "2"
}
}
public static OpItemKey SemanticLayerSourceAddQuery(string moniker, uint sourceKey)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tDel = new SemanticLayerSourceAddQuery()
{
// Source moniker in data model
mon = moniker + "!Sources!" + sourceKey
};
// Create SQL query
var result = somClient.SemanticLayerSourceAddQuery(tDel);
return result;
}

See also:

Working with Data Models