Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query for time period with reporting year start day #141

Open
dosse opened this issue Feb 25, 2021 · 3 comments
Open

Query for time period with reporting year start day #141

dosse opened this issue Feb 25, 2021 · 3 comments

Comments

@dosse
Copy link
Contributor

dosse commented Feb 25, 2021

The technical notes, page 21, describe a feature to query for data according to a start/end time period with reporting year start day = "--07-01". This was probably made for soap. How can the reporting year start day, which is to be applied to the query start/end time period, be specified in the REST query?

@sosna
Copy link
Member

sosna commented Feb 26, 2021

Hi Jens. There are 56 occurrences of reporting year in that document. Could you please point me to the one that indicates how it's used in a SOAP query? I could not find it.

And, I must confess I also don't understand the question :(.

Let's take an organization whose financial year starts on the 1st of April of every year. The reporting year start day would therefore be --04-01.

So, let's imagine the frequency is annual (FREQ=A). I cannot use the YYYY format for time periods, because the period does not represent a calendar year. Instead, I have to use the reporting year convention, i.e. YYYY-A1. So, something like TIME_PERIOD=2020-A1.

In the REST service, the value for the startPeriod and endPeriod parameters must be a valid period. So, you could have something like startPeriod=2010-A1&endPeriod=2020-A1. This can be expected to work with compliant services that support this concept of reporting years being different from calendar years.

But, I'm not sure what you mean with using "--07-01" in the query, unless you want to ask for all the data reported for a reporting year that starts on a 1st of July? If that's the case, then this feature is currently not supported by the API, AFAIK.

@dosse
Copy link
Contributor Author

dosse commented Feb 26, 2021

Hi @sosna,

No problem, let me try to be more specific:

The Technical Notes (page 21) say the following:

844 4.2.14 Time in Query Messages
845 When querying for time values, the value of a time parameter can be provided as any
846 of the Observational Time Period formats and must be paired with an operator. In
847 addition, an explicit value for the reporting year start day can be provided

I have marked the relevant sentence part in bold+italic.

Concretely, the SDMXQuery.xsd foresees the following xml attribute to specify the "reporting year start day" for a time period filter in the SOAP request:

GenericDataQuery - DataWhere - TimeDimensionValue - reportingYearStartDay

The Technical Notes (page 23) give then an example for the response content the server should return in case the "reporting year start day" was provided for a time period filter in the request:

893 Gregorian Period
894 Query Parameter: Greater than 2010
895 Literal Interpretation: Any data where the start period occurs after 2010-12-
896 31T23:59:59.
897 Example Matches:
898 ° 2011 or later
899 ° 2011-01 or later
900 ° 2011-01-01 or later
901 ° 2011-01-01/P[Any Duration] or any later start date
902 ° 2011-[Any reporting period] (any reporting year start day)
903 ° 2010-S2 (reporting year start day --07-01 or later)
904 ° 2010-T3 (reporting year start day --07-01 or later)
905 ° 2010-Q3 or later (reporting year start day --07-01 or later)
906 ° 2010-M07 or later (reporting year start day --07-01 or later)
907 ° 2010-W28 or later (reporting year start day --07-01 or later)
908 ° 2010-D185 or later (reporting year start day --07-01 or later)
909
910 Reporting Period with explicit start day
911 Query Parameter: Greater than or equal to 2010-Q3, reporting year start day = "--
912 07-01"
913 Literal Interpretation: Any data where the start period occurs on after 2010-01-
914 01T00:00:00 (Note that in this case 2010-Q3 is converted to the explicit date
915 range of 2011-01-01/2011-03-31 because of the reporting year start day value).
916 Example Matches: Same as previous example

Note: Here above I have corrected typos in these Technical Notes by marking them in bold+italic.

Coming back to REST, here we can currently only provide a startPeriod and an endPeriod, but no parameter for the corresponding "reporting year start day" value, e.g. "--07-01". What a requester could indeed already do is to convert himself the startPeriod and endPeriod parameters to appropriate calendar days by applying the "reporting year start day" value (as the Technical Notes also explain). If the server could do this instead, this would ease the life of the requester.

Let me know if more clarification is required.

@sosna
Copy link
Member

sosna commented Mar 2, 2021

Thanks, @dosse, it's all clear now :). So, indeed, such a parameter is missing at the moment, and I guess we will be able to tackle that only after the SDMX 3.0 release :(.

@sosna sosna changed the title How to query for time period with reporting year start day = "--07-01" Query for time period with reporting year start day Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Change proposed
Development

No branches or pull requests

2 participants