From 6f625ec7dbf6456daeac5907a21c29cbb74a6ddf Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 18 Jun 2024 11:13:51 +0200 Subject: [PATCH] do both rates to compare and test --- .../intermediate/core/int_core__verification_payments.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/intermediate/core/int_core__verification_payments.sql b/models/intermediate/core/int_core__verification_payments.sql index cf2ad11..accd915 100644 --- a/models/intermediate/core/int_core__verification_payments.sql +++ b/models/intermediate/core/int_core__verification_payments.sql @@ -35,6 +35,7 @@ select p.amount as amount_in_txn_currency, p.currency, (p.amount * r.rate) as amount_in_gbp, + (p.amount * nr.rate) as new_amount_in_gbp, ps.payment_status, p.notes from stg_core__verification_to_payment vtp @@ -49,3 +50,8 @@ left join on p.paid_date_utc = r.rate_date and p.currency = r.from_currency and r.to_currency = 'GBP' +left join + int_simple_exchange_rates nr + on p.paid_date_utc = nr.rate_date_utc + and p.currency = nr.from_currency + and nr.to_currency = 'GBP'