OpItemKey SemanticLayerSourceAddQuery(string mon)
mon. Data model source moniker.
The SemanticLayerSourceAddQuery operation creates an SQL query based on data model source.
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.
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.
{
"SemanticLayerSourceAddQuery" :
{
"mon" : "KHBBAIKKHBCDGOAEBJILIDLMBNKIKJJEOLDDGEOMOCFPLAFB!M!S!PCMGALLKKHBCDGOAEAGKHOMPAJPKDLOPEFJJKKEKPJDIGENGH!Sources!1"
}
}
{
"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: