restructuring, dates schema
This commit is contained in:
parent
89aed285db
commit
224954525e
4 changed files with 164 additions and 6 deletions
|
|
@ -1,6 +0,0 @@
|
|||
with
|
||||
int_core__deal_id_master_list as (
|
||||
select * from {{ ref("int_core__deal_id_master_list") }}
|
||||
)
|
||||
select *
|
||||
from int_core__deal_id_master_list
|
||||
164
models/reporting/general/schema.yaml
Normal file
164
models/reporting/general/schema.yaml
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
models:
|
||||
- name: dates
|
||||
description: |
|
||||
A dates dimension. Each record represents one calendar day.
|
||||
|
||||
All othe columns have handy representations of the date, it's elements, and other relative dates.
|
||||
|
||||
This table is generated with the dbt date package: https://hub.getdbt.com/calogica/dbt_date/latest/.
|
||||
columns:
|
||||
- name: date_day
|
||||
data_type: date
|
||||
description: The date this record represents. All relative dates are relative to this. All derived date components are derived from this.
|
||||
|
||||
- name: prior_date_day
|
||||
data_type: date
|
||||
description: The day before date day.
|
||||
|
||||
- name: next_date_day
|
||||
data_type: date
|
||||
description: The day after date day.
|
||||
|
||||
- name: prior_year_date_day
|
||||
data_type: date
|
||||
description: The same day of the same month, but in the previous year. If date day is Feb 29th, this col returns Feb 28th.
|
||||
|
||||
- name: prior_year_over_year_date_day
|
||||
data_type: date
|
||||
description: The day placed 365 days before the date day. Behaves a bit funny with leap years.
|
||||
|
||||
- name: day_of_week
|
||||
data_type: integer
|
||||
description: The day of the week as a number, were Monday is 1 and Sunday is 7.
|
||||
|
||||
- name: day_of_week_name
|
||||
data_type: text
|
||||
description: The full name of the day of the week.
|
||||
|
||||
- name: day_of_week_name_short
|
||||
data_type: text
|
||||
description: The day of the week as a 3 digit shortened version.
|
||||
|
||||
- name: day_of_month
|
||||
data_type: integer
|
||||
description: The day of the month as a number.
|
||||
|
||||
- name: day_of_year
|
||||
data_type: integer
|
||||
description: The day of the year as a number, where January 1st is 1 and December 31st is 365/366.
|
||||
|
||||
- name: week_start_date
|
||||
data_type: date
|
||||
description: |
|
||||
The full date for the first day of the week of date day.
|
||||
|
||||
It considers Sunday to be the first day of the week.
|
||||
|
||||
- name: week_end_date
|
||||
data_type: date
|
||||
description: |
|
||||
The full date for the last day of the week of date day.
|
||||
|
||||
It considers Saturday to be the last day of the week.
|
||||
|
||||
- name: prior_year_week_start_date
|
||||
data_type: date
|
||||
description: Same as week_start_date, but for the same date day in the previous year.
|
||||
|
||||
- name: prior_year_week_end_date
|
||||
data_type: date
|
||||
description: Same as week_end_date, but for the same date day in the previous year.
|
||||
|
||||
- name: week_of_year
|
||||
data_type: integer
|
||||
description: The week of the year as a number, where the first week is 1 and the last week is 52/53.
|
||||
|
||||
- name: iso_week_start_date
|
||||
data_type: date
|
||||
description: |
|
||||
The full date for the first day of the week of date day, according to ISO specs.
|
||||
|
||||
It considers Monday to be the first day of the week.
|
||||
|
||||
Read more here: https://en.wikipedia.org/wiki/ISO_week_date
|
||||
|
||||
- name: iso_week_end_date
|
||||
data_type: date
|
||||
description: |
|
||||
The full date for the last day of the week of date day, according to ISO specs.
|
||||
|
||||
It considers Sunday to be the last day of the week.
|
||||
|
||||
Read more here: https://en.wikipedia.org/wiki/ISO_week_date
|
||||
|
||||
- name: prior_year_iso_week_start_date
|
||||
data_type: date
|
||||
description: "Read more here: https://en.wikipedia.org/wiki/ISO_week_date"
|
||||
|
||||
- name: prior_year_iso_week_end_date
|
||||
data_type: date
|
||||
description: "Read more here: https://en.wikipedia.org/wiki/ISO_week_date"
|
||||
|
||||
- name: iso_week_of_year
|
||||
data_type: integer
|
||||
description: "Read more here: https://en.wikipedia.org/wiki/ISO_week_date"
|
||||
|
||||
- name: prior_year_week_of_year
|
||||
data_type: integer
|
||||
description: ""
|
||||
|
||||
- name: prior_year_iso_week_of_year
|
||||
data_type: integer
|
||||
description: "Read more here: https://en.wikipedia.org/wiki/ISO_week_date"
|
||||
|
||||
- name: month_of_year
|
||||
data_type: integer
|
||||
description: The month date day belongs to as a number (1 for Jan, 12 for Dec).
|
||||
|
||||
- name: month_name
|
||||
data_type: text
|
||||
description: The month date day belongs to in English.
|
||||
|
||||
- name: month_name_short
|
||||
data_type: text
|
||||
description: The month date day belongs to as a 3 digit shortened version.
|
||||
|
||||
- name: month_start_date
|
||||
data_type: date
|
||||
description: The full date for the first day of the month.
|
||||
|
||||
- name: month_end_date
|
||||
data_type: date
|
||||
description: The full date for the last day of the month.
|
||||
|
||||
- name: prior_year_month_start_date
|
||||
data_type: date
|
||||
description: The full date for the first day of the same month last year.
|
||||
|
||||
- name: prior_year_month_end_date
|
||||
data_type: date
|
||||
description: The full date for the last day of the same month last year.
|
||||
|
||||
- name: quarter_of_year
|
||||
data_type: integer
|
||||
description: The quarter date day belongs to as a number (1 for Q1, 4 for Q4).
|
||||
|
||||
- name: quarter_start_date
|
||||
data_type: date
|
||||
description: The full date for the first date of the quarter.
|
||||
|
||||
- name: quarter_end_date
|
||||
data_type: date
|
||||
description: The full date for the last date of the quarter.
|
||||
|
||||
- name: year_number
|
||||
data_type: integer
|
||||
description: The year date day belongs to as a number.
|
||||
|
||||
- name: year_start_date
|
||||
data_type: date
|
||||
description: The full date for the first day of the year.
|
||||
|
||||
- name: year_end_date
|
||||
data_type: date
|
||||
description: The full date for the last day of the year.
|
||||
Loading…
Add table
Add a link
Reference in a new issue