bool SetCalculatedCubeFormulas(CubeId tCube, SetCalculatedCubeFormulasRes tArg)
tCube. Opened calculated cube instance moniker.
tArg. Parameters of calculated cube formulas changes.
The SetCalculatedCubeFormulas operation changes formulas for calculated cube.
To execute the operation, in the tCube field specify calculated cube instance moniker, and in the tArg field specify change parameters of formulas list. Get calculated cube instance moniker using the OpenCube operation.
In the tArg.its field it is required to create an element where in the dimIds field set up change monikers creating cube coordinate. The list of dimensions can be obtained using the GetCube operation or on opening cube using the OpenCube operation, if corresponding template is selected. Next, it is required to open all dimensions using the OpenDim operation and create a selection using the ChangeDimSelection operation. The obtained selection will determine cube coordinate that will be used to change formulas. In the formulas field create a formula or several formulas, if management of formulas actual period is set up in the cube. To save changes in formulas , use the SaveCalculatedCubeFormulas operation.
The operation result in the logical True if the formulas were changed successfully.
Below is the example of changing formulas by specified coordinate of calculated cube. The request contains cube instance moniker and monikers of dimensions creating cube coordinate. Selection is pre-configured by dimensions. The formula expressions is also sent. The response contains whether formula is successfully changed.
{
"SetCalculatedCubeFormulas" :
{
"tCube" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"its" :
{
"it" :
[
{
"dimIds" :
{
"its" :
{
"it" :
[
{
"dimId" :
{
"id" : "S1!M!S!S2"
}
},
{
"dimId" :
{
"id" : "S1!M!S!S3"
}
},
{
"dimId" :
{
"id" : "S1!M!S!S4"
}
}
]
}
},
"formulas" :
{
"formula" :
[
{
"its" :
{
"it" :
[
{
"expression" : "CUBE_SOURCE[0,0,7]"
}
]
}
}
]
}
}
]
}
}
}
}
{
"SetCalculatedCubeFormulasResult" : "1"
}
public static bool SetCalcCubeFormulas(CubeId moniker, OpenId[] dimMonikers)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetCalculatedCubeFormulas()
{
tArg = new SetCalculatedCubeFormulasRes()
{
its = new GetCalculatedCubeCoordFormula[]
{
new GetCalculatedCubeCoordFormula()
{
dimIds = new OpenIds()
{
its = dimMonikers
},
formulas = new CalculatedCubeFormulas()
{
formula = new CltCubeFormulas()
{
its = new CalculatedCubeFormula[]
{
new CalculatedCubeFormula()
{
expression = "CUBE_SOURCE[0,0,7]"
}
}
}
}
}
}
},
tCube = moniker
};
//Change calculated cube formulas
var result = somClient.SetCalculatedCubeFormulas(tSet);
return result;
}
See also: