CREATE MATERIALIZED VIEW insights.holding_values_raw_mv AS
SELECT
account_id,
asset_id,
dim_value_date,
type,
currency_code,
market_value,
average_cost_per_unit,
purchased_quantity,
average_cost_per_unit_system_currency,
total_cost_system_currency,
CAST(NULL AS DECIMAL) AS deposit_profit_accrued
FROM insights.holding_values_journal_density_mv
UNION ALL
SELECT
account_id,
asset_id,
dim_value_date,
type,
currency_code,
market_value,
average_cost_per_unit,
purchased_quantity,
CAST(NULL AS DECIMAL) AS average_cost_per_unit_system_currency,
CAST(NULL AS DECIMAL) AS total_cost_system_currency,
CAST(NULL AS DECIMAL) AS deposit_profit_accrued
FROM insights.cash_values_journal_density_mv