init
This commit is contained in:
21
dbt/models/rar/lookups/LKP_ASSET_CODE_TYPE_NO.sql
Normal file
21
dbt/models/rar/lookups/LKP_ASSET_CODE_TYPE_NO.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
{{
|
||||
config(
|
||||
materialized="ephemeral",
|
||||
tags=["m_DWH_ASSET_CODE_MU_ASSET_CODE_MAP_SF_C2D_EA_ELIGIBLE_ASSET"],
|
||||
)
|
||||
}}
|
||||
-- In IPC this lookup has policy "Use First Value"
|
||||
select code_type_no, code_type_id
|
||||
from
|
||||
(
|
||||
select
|
||||
code_type_no,
|
||||
code_type_id,
|
||||
row_number() over (
|
||||
partition by code_type_id order by code_type_no
|
||||
) as rn
|
||||
from {{ source("dw_ref_main", "ASSET_CODE_TYPE") }}
|
||||
where
|
||||
a_valid_to = to_date('12/31/9999 00:00:00', 'mm/dd/yyyy HH24:MI:SS')
|
||||
)
|
||||
where rn = 1
|
||||
12
dbt/models/rar/lookups/LKP_MU_ASSET_CODE_MAP_ASSET_FK.sql
Normal file
12
dbt/models/rar/lookups/LKP_MU_ASSET_CODE_MAP_ASSET_FK.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
{{
|
||||
config(
|
||||
materialized="ephemeral",
|
||||
tags=["m_DWH_EL_LIMIT_TE_ASSET_ELIGIBILITY_LIMIT_SF_C2D_EA_SF_TMS_UMI_SF_LED_LLMT"],
|
||||
)
|
||||
}}
|
||||
|
||||
select act.code_type_id, acm.code_value, acm.asset_fk, acm.a_valid_from, acm.a_valid_to
|
||||
from {{ source("dw_ref_main", "ASSET_CODE_TYPE") }} act, {{ ref("m_DWH_ASSET_CODE_MU_ASSET_CODE_MAP_SF_C2D_EA_ELIGIBLE_ASSET") }} acm
|
||||
where act.code_type_no = acm.code_type_no_id
|
||||
and acm.a_valid_to = to_date('31.12.9999', 'DD.MM.YYYY')
|
||||
and act.a_valid_to = to_date('31.12.9999', 'DD.MM.YYYY')
|
||||
Reference in New Issue
Block a user