Limit the LastNPeriod and the Start and End Time Periods according to the current data availability and to the current selection (e.g., freq)
As Hilde,
I want that the lastNPeriod feature as well as the start and end period selectors take the current frequency and related data availability into account,
So that I do not end up with an incomplete or empty data table or chart.
Detailed functional specifications
This ticket complements ticket #641 (closed).
Implement following steps when determining the content of the viz page filters:
- AS TODAY: Get the time periods to be included in the start and end period selectors: structure query with
references=all
to retrieve all structures including the actual content constraint. - NEW: Only if frequency is not pre-selected: Define the Frequency to be used Only if the actual content constraint contains several possible frequencies then execute availableconstraint query with
.../availableconstraint/[flowRef]/[key]/ALL/[frequency dim ID]
including all current selections in the key and with start/end time periodstartPeriod
/endPeriod
parameters (see doc, example: https://nsi-qa-stable.siscc.org/rest/availableconstraint/ILO,DF_SDG_ALL_SDG_A871_SEX_AGE_RT,1.0/.AFG...SEX_T./ALL/FREQ?startPeriod=2014). Note that themode
parameter is not necessary here because the freq dimension is not filtered and so the modeexact
is applied anyway. - NEW: Only if lastNPeriods is selected: Get the last available time period for the selected frequency: availableconstraint query with
.../availableconstraint/[flowRef]/[key]/ALL/TIME_PERIOD
including all current selections in the key but without start/end time period (see doc, example: https://nsi-qa-stable.siscc.org/rest/availableconstraint/ILO,DF_SDG_ALL_SDG_A871_SEX_AGE_RT,1.0/.AFG.A..SEX_T./ALL/TIME_PERIOD). Note that themode
parameter is not necessary here because the time dimension is not filtered and so the modeexact
is applied anyway. - AS TODAY: Get availability for all dimensions: availableconstraint query with
.../availableconstraint/[flowRef]/[key]?mode=available
including all current selections in the key. If lastNPeriods is selected then also set the calculated start time period, else if start/end periods are selected then also set those. (example: https://nsi-qa-stable.siscc.org/rest/availableconstraint/ILO,DF_SDG_ALL_SDG_A871_SEX_AGE_RT,1.0/.AFG.A..SEX_T.?mode=available&startPeriod=2014)
The corresponding data query can be fired before or after step 4.
In essence, this ticket requires new additional ws calls under certain conditions (step 2 and 3). Note that /ALL/[frequency dim ID]
and /ALL/TIME_PERIOD
in the URL will speed up the retrieval because it only returns information for the requested dimension. Whenever the user changes any selection then start again from step 3.
#1321
Additional use case to be covered --> moved toNot implemented
When a dataflow has data for 2020-Monthly but no data for 2020-Annual, then if for instance 'End-date' is 2020-01, and if I change the frequency selection from Monthly to Annual, it results in 2020 being greyed but also selected.
Instead, in this case, End date should be emptied.
Test case sample in DevOps-QA.
This should solve the issue described here:
Original request
I loaded data for 2 different frequencies (Annual and quarterly) and there are timeperiods - for annual data from 1998 until 2021 - for quarterly data from 1998-Q1 until 2022-Q2When I ask the last 3 periods for the annual frequency, I receive only data for the time periods 2020 and 2021, while normally I should receive the time periods 2019,2020 and 2021
When I ask the last 3 periods for the quarterly frequency, I receive the correct data for the time periods 2021-Q4, 2022-Q1 and 2022-Q2
BE2-DF_TEST-1.0-all.xml
BE2-DF_TEST-1.0-data.csv