Skip to content

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

@GregorDeCillia

Description

@GregorDeCillia

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions