Assets Converted

Converts aggregated asset values into reporting currencies using standardized exchange rates.

Purpose

Provide a reporting-ready view of asset values converted into reporting currencies.

This model takes pre-aggregated asset amounts by currency and date and applies standardized exchange rates to express those values in one or more reporting currencies. It enables consolidated reporting, net worth calculations, and cross-currency comparisons.

All conversion logic is centralized here so downstream models do not need to handle exchange rates or conversion rules.

Business Logic

  • Start from the aggregated Assets by Currency transformation
  • Cross join with the Currencies semantic layer to generate reporting currencies
  • Join to Reporting Rates to retrieve applicable exchange rates
  • Apply currency conversion logic:
    • If asset currency equals reporting currency, use the original amount
    • Otherwise, multiply by the applicable exchange rate
  • Round converted values to two decimal places

Output Contract

Definitions

ColumnDescription
dateDate of the asset snapshot (YYYY-MM-DD)
weeknumISO year-week in YYYYWW format, derived from date
currencySource ISO currency code of the asset
amountTotal asset amount in the source currency
reporting_currencyTarget ISO currency code used for reporting
conversion_rateExchange rate applied from currency to reporting_currency
converted_valueAsset value expressed in the reporting currency

Sample & Implementation

Asset values converted into reporting currencies.
dateweeknumcurrencyamountreporting_currencyconversion_rateconverted_value
2025-01-06202502CHF283946.5187954513USD1.0989674596284686312047.98
2025-01-06202502CHF283946.5187954513EUR1.0660045840115921302688.29
2025-01-06202502EUR1877090.8036509664USD1.030921891935134.0
2025-01-06202502EUR1877090.8036509664EUR1.01877090.8
2025-01-06202502USD3888246.5068428973USD1.03888246.51
2025-01-06202502GBP1703006.621185907EUR1.20623174541649132054220.65
2025-01-06202502CHF283946.5187954513GBP0.8837477472496643250937.1
2025-01-06202502USD3888246.5068428973EUR0.97000559373125753771620.86
2025-01-06202502GBP1703006.621185907USD1.243530712117741.03
2025-01-06202502USD3888246.5068428973GBP0.80416188515360433126779.64
{{config (materialized='view')}}

with assets_by_currency as (
    select * from  {{ref('assets_by_currency')}}
),

currencies as (
    select * from {{ref('currencies')}}
),

reporting_rates as (
    select * from  {{ref('reporting_rates')}}
)

select
    abc.date,
    abc.weeknum,
    abc.currency,
    abc.total_amount as amount,
    c.currency_code as reporting_currency,
    COALESCE(rr.value, 1) as conversion_rate,
    ROUND (
        case
            when abc.currency = c.currency_code then abc.total_amount
            else abc.total_amount * rr.value
        end, 2) as converted_value
from currencies c
cross join assets_by_currency abc
left join reporting_rates rr
    on abc.date = rr.date
    and abc.currency = rr.base_currency
    and c.currency_code = rr.quote_currency
order by abc.weeknum

Dependencies

On this page

Star us on GitHub

If you enjoy this content and find it useful, give us a star on GitHub to show your support and stay updated with our latest improvements.