new features dates
This commit is contained in:
parent
ae865b8848
commit
c5cc2e2167
2 changed files with 50 additions and 1 deletions
|
|
@ -1 +1,42 @@
|
|||
with dates as (select * from {{ ref("int_dates") }}) select * from dates
|
||||
with dates as (select * from {{ ref("int_dates") }})
|
||||
select
|
||||
date_day as date_day,
|
||||
prior_date_day as prior_date_day,
|
||||
next_date_day as next_date_day,
|
||||
prior_year_date_day as prior_year_date_day,
|
||||
prior_year_over_year_date_day as prior_year_over_year_date_day,
|
||||
day_of_week as day_of_week,
|
||||
day_of_week_name as day_of_week_name,
|
||||
day_of_week_name_short as day_of_week_name_short,
|
||||
day_of_month as day_of_month,
|
||||
day_of_year as day_of_year,
|
||||
week_start_date as week_start_date,
|
||||
week_end_date as week_end_date,
|
||||
prior_year_week_start_date as prior_year_week_start_date,
|
||||
prior_year_week_end_date as prior_year_week_end_date,
|
||||
week_of_year as week_of_year,
|
||||
iso_week_start_date as iso_week_start_date,
|
||||
iso_week_end_date as iso_week_end_date,
|
||||
prior_year_iso_week_start_date as prior_year_iso_week_start_date,
|
||||
prior_year_iso_week_end_date as prior_year_iso_week_end_date,
|
||||
iso_week_of_year as iso_week_of_year,
|
||||
prior_year_week_of_year as prior_year_week_of_year,
|
||||
prior_year_iso_week_of_year as prior_year_iso_week_of_year,
|
||||
month_of_year as month_of_year,
|
||||
month_name as month_name,
|
||||
month_name_short as month_name_short,
|
||||
lpad(month_of_year::text, 2, '0') || '-' || month_name as month_number_name,
|
||||
lpad(month_of_year::text, 2, '0')
|
||||
|| '-'
|
||||
|| month_name_short as month_number_name_short,
|
||||
month_start_date as month_start_date,
|
||||
month_end_date as month_end_date,
|
||||
prior_year_month_start_date as prior_year_month_start_date,
|
||||
prior_year_month_end_date as prior_year_month_end_date,
|
||||
quarter_of_year as quarter_of_year,
|
||||
quarter_start_date as quarter_start_date,
|
||||
quarter_end_date as quarter_end_date,
|
||||
year_number as year_number,
|
||||
year_start_date as year_start_date,
|
||||
year_end_date as year_end_date
|
||||
from dates
|
||||
|
|
|
|||
|
|
@ -125,6 +125,14 @@ models:
|
|||
data_type: text
|
||||
description: The month date day belongs to as a 3 digit shortened version.
|
||||
|
||||
- name: month_number_name
|
||||
data_type: text
|
||||
description: The month date number with leading zero and full month name (e.g., 01-January, 02-February).
|
||||
|
||||
- name: month_number_name_short
|
||||
data_type: text
|
||||
description: The month date number with leading zero and abbreviated month name (e.g., 01-Jan, 02-Feb).
|
||||
|
||||
- name: month_start_date
|
||||
data_type: date
|
||||
description: The full date for the first day of the month.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue