Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give fiscal_quarter a column_name property #82

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion models/marts/_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ models:
- name: time_spine
time_spine:
standard_granularity_column: date_day # column for the standard grain of your table
custom_granularities:
- name: fiscal_quarter
column_name: almost_fiscal_quarter
columns:
- name: date_day
granularity: day # set granularity at column-level for standard_granularity_column
granularity: day # set granularity at column-level for standard_granularity_column
- name: fiscal_quarter
3 changes: 2 additions & 1 deletion models/marts/time_spine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ days as (
cast_to_date as (

select
cast(date_day as date) as date_day
cast(date_day as date) as date_day,
date_trunc('quarter', date_day) as almost_fiscal_quarter

from days

Expand Down
Loading