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

Time variables with {prefix}-YYYY-Q #16

Open
GregorDeCillia opened this issue Aug 10, 2021 · 1 comment
Open

Time variables with {prefix}-YYYY-Q #16

GregorDeCillia opened this issue Aug 10, 2021 · 1 comment
Labels
feature New feature or request parse time
Milestone

Comments

@GregorDeCillia
Copy link
Contributor

GregorDeCillia commented Aug 10, 2021

The cube sc_table_saved("str:table:defaulttable_delufapi004") (external info page) uses time codes of the form {prefix}-YYYY-Q which are currently not parsed correctly into a date format because the parser expects {prefix}-YYYYQ.

x <- sc_table_saved("str:table:defaulttable_delufapi004")
x$field()
# STATcubeR metadata: 6 x 3
  code          label           parsed         
  <chr>         <chr>           <chr>          
1 APIQ10-2020-1 1. quarter 2020 1. quarter 2020
2 APIQ10-2020-2 2. quarter 2020 2. quarter 2020
3 APIQ10-2020-3 3. quarter 2020 3. quarter 2020
4 APIQ10-2020-4 4. quarter 2020 4. quarter 2020
5 APIQ10-2020-5 annual 2020     annual 2020    
6 APIQ10-2021-1 1. quarter 2021 1. quarter 2021

With a proper update of the parser, the parsed column should be of type <Date>. We should assume that the client skips the "annual" values by providing certain recodes in the JSON. The parser should therefore be able to work with strings of the form

c("APIQ10-2020-1", "APIQ10-2020-2", "APIQ10-2020-3", "APIQ10-2020-4", "APIQ10-2021-1")
@GregorDeCillia GregorDeCillia added feature New feature or request parse time labels Aug 10, 2021
@GregorDeCillia GregorDeCillia changed the title Time variables with {prefix}-YYYY-MM Time variables with {prefix}-YYYY-Q Aug 10, 2021
@GregorDeCillia GregorDeCillia added this to the Version 1.0 milestone Aug 19, 2021
@GregorDeCillia
Copy link
Contributor Author

To clarify: providing a logic to skip the annual values (APIQ10-2020-5) seems a little bit too hacky to me. For time variables with a mixed yearly and quarterly values it would make more sense if the server would provide metadata to indicate a hierarchy structure.

Unfortunately, there is no way to provide this kind of metadata in the STATcube API, but for open data there is a way to define hierarchies in the classification files.

Therefore, the scope of this issue is limited to the {YYYY-Q} format.

@GregorDeCillia GregorDeCillia pinned this issue Jan 25, 2022
@GregorDeCillia GregorDeCillia unpinned this issue Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request parse time
Projects
None yet
Development

No branches or pull requests

1 participant