Assets by Currency

Aggregates asset values by currency over time for reporting and conversion.

Purpose

This model performs no currency conversion.
Amounts are summed as-is, grouping existing asset values by currency and date only.

Provide a currency-level aggregation of asset values, collapsing individual assets into total amounts per currency and time period.

This model is designed as a lightweight reporting layer, enabling:

  • Currency exposure analysis
  • Net worth calculations per currency
  • Downstream currency conversion using reporting rates

It removes asset-level granularity while preserving temporal and currency dimensions.

Business Logic

  • Start from Assets Values transformation
  • Group asset values by:
    • Date
    • ISO week
    • Currency
  • Aggregate asset amounts using SUM
  • Produce one row per currency per date

Output Contract

Definitions

ColumnDescription
dateDate of the asset snapshot (YYYY-MM-DD).
weeknumISO year-week in YYYYWW format, derived from date
currencyISO currency code
total_amountTotal asset value for the given currency and date

Sample & Implementation

Total asset values aggregated by currency and date.
dateweeknumcurrencytotal_amount
2025-01-06202502EUR1877090.8036509664
2025-01-06202502CHF283946.5187954513
2025-01-06202502USD3888246.5068428973
2025-01-06202502GBP1703006.621185907
2025-01-13202503USD3869590.839716449
2025-01-13202503CHF279868.6409824806
2025-01-13202503EUR1892011.4645110695
2025-01-13202503GBP1748268.2568894378
2025-01-20202504EUR1899084.5353983236
2025-01-20202504GBP1720277.8848653354
{{config(materialized='view')}}

with assets_values as (
    select * from {{ref('assets_values')}}
)

select
    date,
    weeknum,
    currency,
    sum(amount) as total_amount
from assets_values
group by date, weeknum, currency
order by 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.