Key Figures
As described in the section about key figure formulas, one of the main differences of key figure structures compared to other structures is the definition of formulas. To be able to support more complex formula systems, the definition of formulas will be separated from the model definition. This section describes the separate initial upload, update and export of these key figure formulas.
Structure
Key figures uploads and exports have the same structure and are specified in JSON.
Key Figures Definition
{
"rootCubeSegment": {
"formulas": [
<KEY_FIGURE_FORMULAS_DEFINITION>,
...
],
"segmentation": <SEGMENTATION_DEFINITION>
}
}On the top level, the definition includes the rootCubeSegment property with the following nested properties:
formulas: Contains the formulas defined for the root cube segment. Key figures not present informulashave no formula. The property is not optional but it may be empty. The order of the entries is not relevant.segmentation: a division of the root segment into smaller segments along a dimension. This property is optional.
Key Figure Formulas Definition
One KEY_FIGURE_FORMULAS_DEFINITION defines the two formulas to be used for a single key figure.
Key Figure Formulas Definition
All properties must always be present.
keyFigureReference.businessKey: the business key of the key figure for which the formulas are givenformulaForLeavesInAllOtherDimensions: the formula to use for calculations of cells where the elements in all other dimensions are leaves in their hierarchy. This is the equivalent of theformulacolumn in the key figure structure definition (cf. key figure formulas).formulaForInnerNodeInAtLeastOneOtherDimension: the formula to use for calculations of cells where at least one element in another dimension is an inner node in its hierarchy. This is the equivalent of theformulaForInnerNodescolumn in the key figure structure definition (cf. key figure formulas).
Formula Definition
There are three possible definitions for a formula.
No Formula Definition
If the formula should not be calculated, only the type property must be present and set to NONE.
String Formula Definition
If the formula should be calculated, the type property must be set to DEFINED and the formula property must contain a non-blank formula string.
Inherited Formula Definition
If the formula definition of the parent segment should be used, only the type property must be present with a value of INHERITED. This is not allowed in the root cube segment, since it has no parent segment.
Segmentation Definition
A SEGMENTATION_DEFINITION defines how a cube segment is further divided into multiple child segments.
Segmentation Definition
All properties must always be present:
dimensionReference: a reference (by plural name) to the dimension along which the "parent" segment is divided into smaller segments. May not reference the key figure or time dimension.children: an ordered list of child segments, each responsible for some trees in the dimension. May be empty.remainder: a non-optional segment for all elements whose roots were not explicitly included in any of the child segments.
Child Cube Segment
A CHILD_CUBE_SEGMENT_DEFINITION defines a cube segment for some trees in a dimension.
Child Cube Segment Definition
All properties are required
structureElementReferences: references (by business key) to roots of the segmented dimension. All elements inside the trees under the roots are in this segment. May be empty.displayName: a descriptive name for the segment to be displayed in the applicationformulas: the formulas for this segment. Key figures which are not listed will behave as if they have the type INHERITED for both formulas.segmentation: a further segmentation of this child segment according to a different dimension
Remainder Cube Segment
A REMAINDER_CUBE_SEGMENT_DEFINITION defines a cube segment for all elements in a dimension that were not explicitly assigned to other child cube segments.
Remainder Cube Segment Definition
The properties are the same as in the child cube segment, except for the missing structureElementReferences property since the structure elements in the remainder are implicitly defined by the other child cube segments in the segmentation.
Upload
A key figures upload works similar to an asynchronous model upload. However, for the key figures uploads, we do not employ multipart uploads, but rather use the content type application/x.de.qvantum-plan.external-key-figures+json to upload a single file. New uploads can be created at the keyFiguresUploads link in the cube resource (cf. navigating to a cube).
Upload Key Figures
The response contains a URL in the Location header. This URL can be used for status polling.
Export
An export of the current key figures is available at the endpoint specified by the keyFigures link in the cube resource (cf. navigating to a cube).
Export Key Figures
Zuletzt aktualisiert