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

Need Data Entry Date for Time Series Data #634

Open
inguyen314 opened this issue May 7, 2024 · 2 comments · May be fixed by #927
Open

Need Data Entry Date for Time Series Data #634

inguyen314 opened this issue May 7, 2024 · 2 comments · May be fixed by #927
Labels
approved-W192HQ23F0232-task4 Only valid if set by MikeNeilson, DanielO, CharlesG priority:medium We care, and will try and get to it soon. timeseries

Comments

@inguyen314
Copy link

inguyen314 commented May 7, 2024

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**
    ]
  ]
}
@MikeNeilson
Copy link
Contributor

MikeNeilson commented May 17, 2024

Probably best to make it optional, 90% (made up number) of usages don't really care, but when you need it there's not going to be another way than through this end point.

@rma-rripken
Copy link
Collaborator

Is there a need for a TsvDqu (or something similar) end-point that returned raw arrays of values?

@MikeNeilson MikeNeilson moved this from To triage to Backlog in CWMS-Data-Api Maintanance Tracking Jun 25, 2024
@MikeNeilson MikeNeilson added the priority:medium We care, and will try and get to it soon. label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-W192HQ23F0232-task4 Only valid if set by MikeNeilson, DanielO, CharlesG priority:medium We care, and will try and get to it soon. timeseries
Projects
Status: Backlog
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants