Complement Unit-of-Measure (UoM) feature
Follow-up ticket to complement the UoM implementation that was intended with ticket DE#113.
Generically spoken, the display rules to be respected can be summarised as:
The (virtual) UoM component will be displayed at the “highest possible level” in the table according to the dispositions of all dimensions implied in the UoM definition (either directly as dimension or through the attachment of attributes to dimensions), the order of the levels from highest to lowest being defined as:
- Table header (displayed in table sub-title)
- Row Section
- Row or Column
- Cell = Row/Row Section and Column
Exception: Any dimension that would normally be part of the (virtual) UoM component due to its direct definition in the annotation UNIT_MEASURE_CONCEPTS, but that has been placed through the table customisation feature (by default or by the user) into a specific axis (Row Section, Row or Column), which is different from that calculated for the (virtual) UoM component, will be excluded from the (virtual) UoM component and be displayed separately/normally. This functional choice has been made to not disturb users who see and place dimensions in the table customisation panel in specific axes.
Based on the original placement of all dimensions that are finally combined into the (virtual) UoM component, the “highest possible level”, at which the (virtual) UoM component will be displayed, is the:
- Table header ("case 1"): if all of those dimensions are placed in the Table header because the dimensions have single selections or the underlying attributes are attached at dataset level)
- Row Section ("case 4"): if at least some of those dimensions are placed in Row Sections and none in Rows or Columns
- Row ("case 2"): if at least some of those dimensions are placed in Rows and none in Columns
- Column ("case 3"): if at least some of those dimensions are placed in Columns and none in Rows or Row Sections
- Cell ("case 5"): if at least some of those dimensions are placed in Rows or Row Sections and some others are placed in Columns
According to these rules, the following remaining issues are to be addressed:
-
Case 2 (UoM labels are displayed as (virtual) Row dimension): "At least one dimension in the derived attachment level of the full UoM is on the Row axis of the table but none of those dimensions are on the Column axis: the UoM label is the same for all cells of each row of the table."
Example: Dataset with (UoM attached to time series)
Issue: The "Adjustment indicator", which was placed in the Row Section axis, is merged into the UoM labels, but it should not be merged and stay instead in the Row section area. -
Case 4 (UoM labels are displayed as (virtual) Row Section dimension): "At least one dimension in the derived attachment level of the full UoM is on the Row section axis of the table but none of those dimensions are on the Row or Column axes: the UoM label is the same for all cells of each row section of the table.", the "Time period" dimension is to be placed on Rows, all other dimensions are to be placed on the Row Section axis to see the issue.
Example: Dataset with (UoM attached to time series)
Issue: The (virtual) UoM dimension is placed on Rows, but instead it should be in the Row section area. -
Case 5 (UoM labels are displayed as footnotes at Cell level): "at least one dimension in the derived attachment level of the full UoM is on the Column axis of the table and at least one other of those dimensons is either in the Row or Column axes: the UoM label is potentially different for each cells in the table."
Example: Dataset with (UoM attached to time series), the "Adjustment" dimension is to be placed on the Columns to see the issue.
Issue: UoM dimensions (here 'PriceBase' and 'Transformation ') that have single values should not be in the table header, where they would normally be, but be merged into the (virtual) UoM component labels at cell level.
Additional rule:
-
If the NOT_DISPLAYED annotation is attached to an item/code of a dimension or an attribute listed in the UNIT_MEASURE_CONCEPTS, this item should be excluded from the UoM label. This is to complement the currently already non-displayed elements defined in "sdmx"/"units"/"rejectedValueIds": ["_L", "_T", "_Z"]
Note: This new feature makes fully empty labels possible in case all items to be concatenated are marked as "NOT_DISPLAYED". When this happens at the dataset or observation level then the related footnote is omitted, otherwise the related cell is left empty.
Example: Dataset with the NOT_DISPLAYED annotation attached to UNIT_MULT=0
Issue: The UoM label should not include the label for UNIT_MULT=0.
Postponed new feature (not yet to be implemented):
- [/] If an attribute is involved in the UoM construction, is attached at lower levels than dataset, is mandatory and if the data message only contains one single value for that attribute, then - for the purpose of the UoM generation - the attachment level for that attribute can be automatically raised to the dataset-level.
Example: Dataset with mandatory UNIT_MULT attribute and one single value
Issue: The (virtual) UoM component should be shown in the table sub-title because UNIT_MEASURE dimension and UNIT_MULT have both single values.
Note: The SDMX-JSON data message doesn't yet allow specifying if an attribute is mandatory. This has been requested. If implemented, then the attribute should have aassignmentStatus
property with the valueMandatory
. Therefore, the implementation of this rule is postponed.