bool SetDashboardExpressionField(string mon, DashboardExpressionField tArg)
mon. Moniker for working with calculated fact of information panel data source.
tArg. Calculated fact settings that should be determined.
The SetDashboardExpressionField operation changes calculated fact settings of information panel data source.
To execute the operation, in the mon field specify moniker of opened information panel instance with the !Sources!data source key!Expressions!calculated fact key postfix, and in the tArg field specify calculated fact settings that should be applied. The moniker can be obtained on executing the OpenDashboard operation.
The operation results in the logical True if the settings were changed successfully.
Below is the example of changing calculated fact settings. The request contains the moniker of calculated fact and the list of settings. The response contains whether changes were applied successfully.
{
"SetDashboardExpressionField" :
{
"mon" : "LKACHLFPHPFFGOAEFAJMIHOHCKLEPLKEEIENANDBMODOBJMH!M!S!PHOONDMFPHPFFGOAEGILOHDKLDDEDFAAEEJAAJAMKHGKPJBCK!Sources!1!Expressions!1",
"tArg" :
{
"k" : "1",
"n" : "Calculated value",
"calendarLevel" : "Year",
"calcMethod" : "BySelection",
"expression" : "@[FIELD 3]\/2"
}
}
}
{
"SetDashboardExpressionFieldResult" : "1"
}
public static bool SetDashboardExpressionField(string moniker, uint sourceKey, uint calcFactKey, string newExpression)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetDashboardExpressionField()
{
tArg = new DashboardExpressionField()
{
k = calcFactKey,
calcMethod = CubeCalcMethod.BySelection,
calendarLevel = DimCalendarLvl.Year,
expression = newExpression,
n = "Calculated value"
},
// Moniker for working with calculated facts
mon = moniker + "!Sources!" + sourceKey + "!Expressions!" + calcFactKey
};
// Change calculated fact
var result = somClient.SetDashboardExpressionField(tSet);
return result;
}
See also: