commit wip
This commit is contained in:
parent
335fccd57e
commit
daa93c056c
1 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,9 @@ with
|
||||||
stg_resolutions__incidents as (
|
stg_resolutions__incidents as (
|
||||||
select * from {{ ref("stg_resolutions__incidents") }}
|
select * from {{ ref("stg_resolutions__incidents") }}
|
||||||
),
|
),
|
||||||
|
int_daily_currency_exchange_rates as (
|
||||||
|
select * from {{ ref("int_daily_currency_exchange_rates") }}
|
||||||
|
),
|
||||||
logs_timeline as (
|
logs_timeline as (
|
||||||
select
|
select
|
||||||
id_incident,
|
id_incident,
|
||||||
|
|
@ -35,7 +38,7 @@ with
|
||||||
from stg_resolutions__incidents
|
from stg_resolutions__incidents
|
||||||
),
|
),
|
||||||
damage_reported_items as (
|
damage_reported_items as (
|
||||||
select id_incident, jsonb_array_elements(damage_report_items::jsonb) as item -- No need for 'Items' if already an array
|
select id_incident, jsonb_array_elements(damage_report_items::jsonb) as item,
|
||||||
from stg_resolutions__incidents
|
from stg_resolutions__incidents
|
||||||
where damage_report_items is not null
|
where damage_report_items is not null
|
||||||
),
|
),
|
||||||
|
|
@ -53,6 +56,7 @@ with
|
||||||
coalesce((cm.corrective_measure ->> 'SettlementAmount')::numeric, 0)
|
coalesce((cm.corrective_measure ->> 'SettlementAmount')::numeric, 0)
|
||||||
) as accepted_amount_in_txn_currency
|
) as accepted_amount_in_txn_currency
|
||||||
from damage_reported_items dri
|
from damage_reported_items dri
|
||||||
|
left join int_daily_currency_exchange_rates cer
|
||||||
left join
|
left join
|
||||||
lateral jsonb_array_elements(
|
lateral jsonb_array_elements(
|
||||||
case
|
case
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue