The Expand Date Range pre-process function is used when your source data provides a start date, an end date, or both, and you need to generate one row per day within that date range. This function automatically expands each record into multiple date-level rows, ensuring your dataset is compatible with TapClicks’ date-driven dashboards and metrics.
This pre-processor is especially useful when your data source summarizes metrics over a period rather than providing daily values. By expanding the date range, the SmartConnector can load, aggregate, and visualize the data correctly.
Use this function whenever:
Your source file provides a date span (e.g., Start Date = 2023-01-01 and End Date = 2023-01-05).
Your file only contains a Start Date and you want to expand for a set number of days using offsets.
Your metrics (clicks, impressions, spend) are reported for an entire period but TapClicks expects daily rows.
You need to transform weekly, biweekly, or monthly data into daily entries.
Start Date
The column containing the start date for each record.
End Date
The column containing the end date for each record.
Leave blank if you intend to use offsets.
Starting Offset
Allows you to generate dates even if your file does not include an end date.
Example: Start Date = 2023-03-01, Starting Offset = 0 → begin expansion at 2023-03-01.
Increment Offset By
Defines the number of days to add each time when generating new date rows.
Example: Increment Offset By = 1 → generate one row per day.
Some platforms provide metrics aggregated for a week. For example:
After applying Expand Date Range:
Output (7 new rows):
2023-04-01 → Clicks 700, Impressions 14,000
2023-04-02 → Clicks 700, Impressions 14,000
…
2023-04-07 → Clicks 700, Impressions 14,000
The values repeat because the function expands the date range but does not divide the metrics. TapClicks will handle calculations later as needed.
Suppose your file contains only a Start Date:
If your reporting period is always 3 days, you can set:
Starting Offset = 0
Increment Offset By = 1
This produces:
2023-06-01
2023-06-02
2023-06-03
Each row repeats the Reach value.
A record like:
Will expand into 31 rows, one for each day.
This is critical for TapClicks dashboards, which rely on daily timestamped data.
Sample Dataset and Output
Input Sample
Output After Expansion
All other columns repeat exactly as in the original file.
Ensure your date columns use a supported format (e.g., yyyy-mm-dd).
If your source data includes invalid or reversed date ranges, correct them before processing.
Use offsets only when the source does not provide an End Date.
Be aware that Expand Date Range does not prorate metrics — it only repeats values.
If you require metric prorating (distributing values across days), you'll need an external custom pre-process function.
Summary
The Expand Date Range function is a reliable way to convert summarized or ranged date data into daily records. This transformation ensures accurate ingestion into TapClicks and supports proper charting, filtering, and metric comparisons across the platform. It is simple to set up, highly flexible, and essential when working with weekly, monthly, or multi-day aggregated datasets.
There is often more than one way to solve a problem in the Tapclicks platform, so it's important to consider how each one could impact the performance of your instance. Here are some key points to keep in mind:
Advanced calculations: While powerful, advanced calculations can slow performance with large datasets. Use simpler calculations when possible and reserve advanced ones for when necessary to maintain efficiency.
Limit CASE statements: Keep CASE statements to 10 branches or fewer. Larger ones can slow processing, so simplify or break them into smaller segments for better performance.
Data lookups for large conditions: For complex conditions, consider using data lookups from external sources like Google Sheets to simplify logic and improve performance.