Can we create a timeSeries with an end date
Posted in 1999
Topics: Jobs, Consulting & Announcements
Hello Everyone, I have a question that I could not locate an answer for, perhaps you can help me with. In IDS-UDO TimeSeries datablade module, we can create a calendar with a starting timestamp, a calendar pattern, and a calendar pattern starting timestamp. What about if we knew the ending date, can we state it also in the definition? For example, if we consider the commercial airline schedule, it has a pattern, a calendar, a starting date, and an ending date (which can be re-newed but with a different pattern). If we can not state the ending date in the definition, how can we track the validity of our queries using the TimeSeries? Regards, Amgad Al-Sisi InFocus- Senior Technical Consultant
Amgad Al-Sisi (amgad@starnet.com.eg) wrote:
: example, if we
: consider the commercial airline schedule, it has a pattern, a calendar,
: a starting date,
: and an ending date (which can be re-newed but with a different pattern).
Why not carry the acticity range as a Period data type in an additional
column on the table, or else aggregate the Period and the Timeseries into
a new data type?
1. CREATE TABLE Flights (
Id Flight_Code NOT NULL,
Activity_Period Period NOT NULL,
Passengers TIMESERIES('etc') NOT NULL
);
Then you can do:
SELECT COUNT(*)
FROM Flights F
WHERE Overlaps ( F.Activity_Period, TODAY::Period );
and
SELECT COUNT(*)
FROM Flights F
WHERE -- Predicate to get the date range right
AND -- Predicate to get the Timeseries question answered.
2. (Not so attractive, but more OO)
CREATE ROW TYPE Bounded_Timeseries (
Activity_Period Period NOT NULL,
Passengers Timeseries('etc') NOT NULL
);
Now, turn all of your Timeseries requests into functions
that operate over this type.
Hope this helps!