fixed model

This commit is contained in:
Joaquin Ossa 2024-11-25 10:11:05 +01:00
parent 0c5dd298ed
commit aaf512a288
2 changed files with 21 additions and 38 deletions

View file

@ -1,22 +1,16 @@
{% set sigma_threshold = var("sigma_threshold", 3) %}
{% set days_to_consider = 14 %}
{% set yesterday = "(current_date - interval '1 day')" %}
-- with
-- stg_core__country as (select * from {{ ref("stg_core__country") }}),
-- stg_core__currency as (select * from {{ ref("stg_core__currency") }})
-- select
-- co.id_country,
-- co.iso_2,
-- co.iso_3,
-- co.country_name,
-- co.iso_num_code,
-- co.phone_code,
-- co.id_preferred_currency,
-- cu.currency_name as preferred_currency_name,
-- cu.iso4217_code as preferred_iso4217_code,
-- co.dwh_extracted_at_utc
-- from stg_core__country as co
-- left join stg_core__currency cu on cu.id_currency = co.id_preferred_currency
select {{ yesterday }} - interval '{{ days_to_consider }} "days"'
with
stg_core__country as (select * from {{ ref("stg_core__country") }}),
stg_core__currency as (select * from {{ ref("stg_core__currency") }})
select
co.id_country,
co.iso_2,
co.iso_3,
co.country_name,
co.iso_num_code,
co.phone_code,
co.id_preferred_currency,
cu.currency_name as preferred_currency_name,
cu.iso4217_code as preferred_iso4217_code,
co.dwh_extracted_at_utc
from stg_core__country as co
left join stg_core__currency cu on cu.id_currency = co.id_preferred_currency