lastNObservations default setting
The objective is to implement the support of the sdmx annotation allowing to define a default for the SDMX data query parameter lastNObservations.
Acceptance Criteria
- The annotation called DEFAULT is defined and returned at the dataflow level.
- The title contains a composed string separated by comma of which one sub-string contains the syntax LASTNOBSERVATIONS=n where n is an integer > 0. If =n is not specified, then it is considered being =1.
- The sdmx-json format looks like this:
"annotations":[{
"type": "DEFAULT"
"title": "DIM3=CODE1+CODE2,DIM6=CODE,TIME_PERIOD_START=2013-01,TIME_PERIOD_END=2018-12,LASTNOBSERVATIONS=1"
}]
- When this annotation setting is returned in the sdmx-json message, then the parameter "lastNObservations=n" (where n is the specified integer) is added by the DE into the Rest URL query sent to the SDMX web service. It implies that the equivalent number of latest time series observations per time series will be returned for table and chart views of a given dataflow.
Example 1
- If a dataflow has yearly data and sparse observations within the default time period range from 2014 to 2018 (range from configuration).
- This dataflow has also an annotation defined at dataflow level:
"annotations":[{
"type": "DEFAULT"
"title": "LASTNOBSERVATIONS=2"
}]
- Then the default displayed table and chart view can contain data for
- time periods 2017 and 2018 for time series 1 (--> if 2017 and 2018 are the latest two time periods for this time series within the given range)
- time periods 2015 and 2017 for time series 2 (--> if 2015 and 2017 are the latest two time periods for this time series within the given range) and
- time period 2014 for time series 3 (--> if 2014 is the latest time period for this time series within the given range).
Example 2
- If a dataflow has yearly data and sparse observations within the default time period range from 2014 to 2018 (range from configuration).
- This dataflow has also an annotation defined at dataflow level like so:
"annotations":[{
"type": "DEFAULT"
"title": "TIME_PERIOD_START=2013,TIME_PERIOD_END=2015,LASTNOBSERVATIONS"
}]
- Then the default displayed table and chart view can contain data for
- time period 2015 for time series 1 (--> if 2015 is the latest time period for this time series within the given new range 2013 to 2015)
- time period 2015 for time series 2 (--> if 2015 is the latest time period for this time series within the given new range 2013 to 2015) and
- time period 2014 for time series 3 (--> if 2014 is the latest time period for this time series within the given new range 2013 to 2015).
NOTE: This example contains also the application of a dataflow-specific default time period range which is NOT part of this issue.
Dataflows illustrating the examples
- With annotation "type": "DEFAULT" and "title": "LASTNOBSERVATIONS=1" https://dotstatcor-dev2.main.oecd.org/PMIntranetDataExplorer/#/vis?locale=en&endpointId=disseminate&agencyId=ILO&code=DF_YI_ALL_LAI_INDE_NOC_RT&version=1.1
- With annotation "type": "DEFAULT" and "title": "REF_AREA=SLV, LASTNOBSERVATIONS=2" https://dotstatcor-dev2.main.oecd.org/PMIntranetDataExplorer/#/vis?locale=en&endpointId=disseminate&agencyId=ILO&code=DF_YI_ALL_LAI_INDE_NOC_RT&version=1.2
Edited by jean-baptiste nonin