Skip to content

Commit

Permalink
Merge pull request #29 from DW-BI-Project/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
gracia10 committed Jul 2, 2023
2 parents 4999421 + 44d67c9 commit 1968a75
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions silverwork_dbt/models/marts/agg/agg_continuous_projects.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
with projects as (
select * from {{ ref('stg_raw_data__projects') }}
where continuous_project_start_year IS NOT NULL
and continuous_project_start_year not in ('nan' , 'None')
and end_date >= start_date
),

filter as(
{% if target.type == 'snowflake' %}
select *
, year - continuous_project_start_year AS duration_years
from projects
where continuous_project_start_year IS NOT NULL
and start_date - end_date >= 0
{% else %}
select year , continuous_project_start_year
, CAST(year AS int) - CAST(continuous_project_start_year AS int) AS duration_years
from projects
{% endif %}
)
select * from filter

0 comments on commit 1968a75

Please sign in to comment.