Skip to content

Need Data Entry Date for Time Series Data #634

Closed
@inguyen314

Description

@inguyen314

I have a report that extracts forecast time series for the next three days along with the forecast date (data_entry_date)

I need the "data_entry_date" for all values when using the TimeSeries API.

SQL Example

select cwms_util.change_timezone(date_time, 'UTC', 'CST6CDT') as date_time
    ,value
    ,cwms_ts_id
    ,cwms_util.split_text(cwms_ts_id, 1, '.') as location_id
    ,unit_id
    ,to_char(cwms_util.change_timezone(data_entry_date, 'UTC', 'CST6CDT'), 'mm/dd HH24:MI') as data_entry_date
from CWMS_20.AV_TSV_DQU
where cwms_ts_id = 'St Charles-Missouri.Stage.Inst.6Hours.0.RVFShef-FF'
    and unit_id = 'ft'
    and date_time = to_date('05-07-2024 ' || '12:00' ,'mm-dd-yyyy hh24:mi');

right now, CDA returns this now.
Current Data:

{
"values": [
    [
      1715018400000,
      25.3,
      0
    ],
    [
      1715040000000,
      25.199999999999996,
      0
    ],
    [
      1715061600000,
      25.1,
      0
    ]
  ]
}

I would like it to include the data entry date along side. Although I am not sure if this is the best way to go about it, but just as an example:

New Data:
Proposed payload:

{
"values": [
    [
      1715018400000,
      25.3,
      0,
     **data_entry_date**
    ],
    [
      1715040000000,
      25.199999999999996,
      0,
     **data_entry_date**
    ],
    [
      1715061600000,
      25.1,
      0,
     **data_entry_date**
    ]
  ]
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions