Handling Missing Values | Teradata Vantage - Handling Missing Values within a Timebucket - Analytics Database - Teradata Vantage

Time Series Tables and Operations

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
tuc1628112453431.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
sfz1493079039055
lifecycle
latest
Product Category
Teradata Vantageā„¢

When a missing value is present within a timebucket (for example, the NULL value inserted in the TEMPERATURE column in Table and Data Definition for Time Series Aggregates Examples), the value is ignored and it is not included in the calculation of the aggregate result. This is consistent with the behavior of existing aggregate functions in Vantage.

The example shows the result of an AVERAGE with NULL values:

SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, AVG(TEMPERATURE), COUNT(*)
FROM OCEAN_BUOYS
WHERE TD_TIMECODE BETWEEN TIMESTAMP '2014-01-06 08:00:00' AND TIMESTAMP '2014-01-06 10:30:00'
AND BUOYID = 0
GROUP BY TIME (MINUTES(10) AND BUOYID)
ORDER BY 2,3;

Result:

TIMECODE_RANGE GROUP BY TIME(MINUTES(10)) BUOYID Average(TEMPERATURE) COUNT(*)
('2014-01-06 08:00:00.000000+00:00', '2014-01-06 08:10:00.000000+00:00') 1 0 54 3
('2014-01-06 08:10:00.000000+00:00', '2014-01-06 08:20:00.000000+00:00') 2 0 55 2

The null value was omitted from the result calculation.

If this behavior is not desired there are strategies to clean the series data so the missing values are removed or updated with a value. For more information on these strategies, see: