filltimegaps

Add rows to a data extract containing missing dates in a date range.

Introduction

Use the filltimegap enrichment to add new rows to a data extract that contain any missing values in a date or time range. For example, if you have the dates for the start and end of a week, use this enrichment to add a row to the data extract for each missing date in the date range of the week. You can also choose the time interval to use and the format of the date.

Use the filldown enrichment to populate the empty fields in the new rows.

Creating the enrichment

For more information on creating an enrichment, see Using custom scripts.

Configuring the enrichment

To configure the enrichment, fill in the following fields. Required fields are marked with an asterisk (*).

Timestamp Field*

Enter the name of the column that contains the date or time range for which to add in the missing values.

Timestamp Format*

Enter the format of the time or date range for which to add in the missing values. For example %Y-%m-%d or %h:%s.

Interval

Select the time interval to determine how many additional rows to add to the data extract.

For example, the range across two rows is 2022-01-20 and 2022-01-22. If you select day then one row is added for the date 2022-01-21.

In another example, if the date is the same across two consecutive rows and you select hour then twenty three new rows are added between the two dates - one for each hour interval.

Presorted

Select this option if the data extract has been sorted prior to the enrichment. This makes the enrichment faster.

Subtable

Enter the name for a subtable that you want to contain the enriched data. The enrichment is applied to the whole data extract, then the enriched data is output into the subtable you have named here.

This subtable is a temporary table, which means it only exists for this custom script. You can apply additional instructions within the same custom script to the subtable. However, the subtable cannot be used in any other custom scripts.

Example

Enrichment configuration

Timestamp Field*

Campaign Start

Timestamp Format*

%Y-%m-%d

Interval

Day

Presorted

Select this field.

Data table before enrichment

Campaign

Campaign Start

Clicks

Aerified

2022-11-01

12345

Kanlam

2022-11-05

56789

Data table after enrichment

Campaign

Campaign Start

Clicks

Aerified

2022-11-01

12345

2022-11-02

2022-11-03

2022-11-04

Kanlam

2022-11-05

56789