dim_dates Dataset Overview

Our Date Dimension / dim_date table unlocks your time based analytics by providing core date components along with enhanced attributes like holidays, business days and more. Spend less time on complex date calculations and more on extracting insights from your data.

Key Features

Core Components

Business Benefits

Data Dictionary

Name Type Description
date_id Number Unique id for the date
date Date The calendar date
day Number The day component of the date
weekday Varchar The name of the day of week
day_of_week Number Numeric representation of the day of week
month Number Numeric representation of the month
month_start Date The first day of the month
month_end Date The last day of the month
month_name Varchar The name of the month
year Number The year component of the date
year_start Date The first day of the year
year_end Date The last day of the year
year_month Varchar Combination of year and month: YYYY-MM
is_leap_year Boolean Indicates if the year is a leap year
week_number Number The week number of the year
week_start Date The first day of the week (Sunday)
week_end Date The last day of the week (Saturday)
is_weekday Boolean Indicates if the day is a weekday
is_weekend Boolean Indicates if the day on the weekend
is_holiday Boolean Indicates if the day is a holiday
is_holiday_adjacent Boolean Flags the business day immediately before and after a holiday, as well as any days in between, as TRUE
is_business_day Boolean Indicates if the day is a business day (not a weekend and not a holiday)
prior_year_date_day_of_week_aligned Date Last year's equivalent day, day of week aligned. Example: Friday 1/10/2025 is aligned to Friday 1/12/2024
prior_month_date_day_of_week_aligned Date Last month's equivalent day, day of week aligned. Example: Friday 1/10/2025 is aligned to Friday 12/13/2024

Usage Examples

YoY reporting of event data by aligning corresponding days of the week

SELECT
    f.date,
    f.events,
    d.last_year_date,
    f_last_year.events AS last_year_events,
    events - last_year_events AS event_diff
FROM
    fct_event f
JOIN dim_date d
    ON f.date = d.date
JOIN fct_event f_last_year
    ON d.last_year_date = f_last_year.date

Consistently group event data by month and year

SELECT
    d.year,
    d.month,
    SUM(f.events)
FROM
    fct_event f
JOIN dim_date d
    ON f.date = d.date
GROUP BY d.year, d.month
ORDER BY d.year, d.month

Business Logic Notes

prior_year_date_day_of_week_aligned

Technical Details

Getting Started

The dim_dates dataset is available for purchase on the Snowflake Marketplace. Contact us to learn more about implementing dim_dates in your data warehouse.