Data Dictionary Overview
Konsolidat uses a medallion architecture with 101 dbt models in four layers. Reference data (chart of accounts, entities, groups, rates, scenarios) is not in dbt: konsol owns it and writes it through to ClickHouse tables that the models read as source()s. There are no CSV seeds (the directory was deleted in konsolidat 85dff3b, #147).
Measured against repo/dbt_project on main, 2026-11-05.
Model Counts
| Layer | Schema | Models | Materialization |
|---|---|---|---|
| Staging | epm_staging | 30 | Views (7 canonical, 16 d365_fo, 7 erpnext) |
| Bronze | epm_bronze | 16 | Tables (2 incremental) |
| Silver | epm_silver | 10 | Tables |
| Gold | epm_gold | 45 | Tables (3 incremental, 2 views) |
The staging layer is a multi-ERP canonical interface: 7 canonical
stg_*models eachUNION ALLthe adapters listed invar('erp_sources'). The default is an empty list (konsolidat#207): no ERP connector is built, the trial-balance upload is the canonical source, and every canonical model compiles to an empty, correctly typed relation. See Staging.
Data Lineage
graph TD
ERP["<b>ERP (Airbyte)</b><br/>D365 F&O or ERPNext raw tables in epm_raw"]
TBS["<b>Trial Balance Submission</b><br/>konsol writes epm_raw.trial_balance_submissions"]
REF["<b>Governed reference data</b><br/>konsol doctypes write epm_staging.* and epm_gold.*"]
ERP --> STG["<b>Staging views</b><br/>D365 F&O and ERPNext adapters → stg_gl_entries, stg_accounts, ..."]
STG --> BRZ["<b>Bronze</b><br/>bronze_general_journal_account_entries, bronze_legal_entities, ..."]
TBS --> BTS["<b>Bronze</b><br/>bronze_trial_balance_submissions"]
BTS --> STM["<b>silver_tb_movements</b><br/>declared basis → period movements, year-end close"]
BRZ --> SGL["<b>silver_gl_entries</b><br/>GL lines + submitted trial balances, one shape"]
STM --> SGL
REF --> SMA["<b>silver_main_accounts</b><br/>the governed chart (epm_staging.main_accounts)"]
SMA --> SGL
SGL --> TB["<b>gold_trial_balance</b><br/>P&L, balance sheet, YTD, cash flow, hierarchy roll-ups"]
TB --> CTB["<b>gold_consolidated_trial_balance</b><br/>governed rates, ownership chain, CTA"]
REF --> CTB
CTB --> FCTB["<b>gold_fully_consolidated_tb</b><br/>+ IC eliminations + CTA + topside + equity method + deal journals"]
REF --> BUD["<b>gold_spread_budget</b><br/>annual spread + monthly input"]
TB --> SCN["<b>gold_scenario_trial_balance</b><br/>actual + budget scenarios → variance"]
BUD --> SCN
FCTB --> API["<b>Datasets → konsol API → Excel add-in</b><br/>=K.EPM(), =K.CF(), ..."]
SCN --> API
TB --> API
Key Lineage Paths
| Path | Flow |
|---|---|
| Reporting | stg_gl_entries → bronze_general_journal_account_entries → silver_gl_entries → gold_trial_balance → P&L, balance sheet, YTD, cash flow |
| Trial-balance upload | epm_raw.trial_balance_submissions → bronze_trial_balance_submissions → silver_tb_movements → silver_gl_entries (same path from there) |
| Consolidation | gold_trial_balance_by_partner + gold_entity_ownership + governed rates → gold_consolidated_trial_balance → IC eliminations, CTA, topside, equity method, deal journals → gold_fully_consolidated_tb → gold_consolidated_ytd, gold_consolidated_cash_flow, gold_consolidation_waterfall |
| Budgeting | epm_gold.budget_annual_input + epm_gold.budget_monthly_input + epm_gold.spread_profiles → gold_spread_budget |
| Variance | gold_trial_balance + gold_spread_budget + silver_budget_entries → gold_scenario_trial_balance → gold_variance_analysis, gold_variance_ytd, gold_variance_quarterly |
| Hierarchies | epm_staging.reporting_hierarchies → gold_reporting_hierarchy → gold_reporting_hierarchy_closure → gold_tb_at_hierarchy_node, gold_budget_at_hierarchy_node, gold_variance_at_hierarchy_node |
Layer Descriptions
Staging
Views over the Airbyte raw tables (epm_raw). Per-ERP adapters rename and type source columns into one canonical shape; the canonical models union the adapters and harmonise dimension values through konsol's Dimension Mapping crosswalk. See Staging.
Bronze
Typed ClickHouse tables built from the canonical staging views, plus bronze_trial_balance_submissions, which reads the claimed trial-balance batches konsol lands in epm_raw. No business logic. See Bronze Models.
Silver
Cleaned and joined data: GL lines joined to journal headers and to the governed chart; submitted trial balances normalised to period movements; ERP exchange rates held as true rates (the adapter resolves D365's ConversionFactor once, #138); each entity's functional currency from konsol's Entity master. See Silver Models.
Gold
Business-ready models the konsol API and the Excel add-in read through Datasets. Trial balance, P&L, balance sheet, cash flow, consolidation (translation, ownership, intercompany, CTA, topside, equity method, acquisitions and disposals), budgets, scenarios and variance, reporting-hierarchy roll-ups, and data-quality queues. See Gold Models.
Governed reference data
Formerly CSV seeds. konsol doctypes (Main Account, Entity, Consolidation Group, Group Exchange Rate, Scenario, Spread Profile, Cash Flow Category, Reporting Hierarchy, ...) write through to epm_staging.* and epm_gold.* tables on publish; epm_staging.sync_watermark records each sync and assert_staging_not_stale fails the build when a table is emptied or missed by the latest reconcile. See Reference Data.
Dimension System
Dimensions are declared in konsol's Dimension doctype and regenerated into var('dimensions') in dbt_project.yml (the konsol-managed vars block; never hand-edited). A site may declare none (konsol#230); the macros then render no dimension columns. The demo site declares three:
| Column | Source column | In budget |
|---|---|---|
dim_cost_center | dim_cost_center | Yes |
dim_department | dim_department | Yes |
dim_business_unit | dim_business_unit | No |
Dimensions propagate through the models via dim_select(), dim_group_by(), dim_join_on() and the other dimension_helpers.sql macros. See Adding Dimensions.