maiven gateway · online··
manifest · 1d ago
Sign in
Back to catalog
MAIVENmodelmarts

mart_gl_balances

beta
mart table

Posted GL balances by account, period, and cost center.

Definition

One row per (period × gl_account × cost_center) summarising posted journal lines. `net_amount` is the balance computed as sum(debit) - sum(credit); the sign follows the account's normal side. Built only from posted entries (drafts/reversed excluded). The starting point for the trial balance and financial statements.

What it means
Watch out for
  • highSumming debit and credit into one number

    The balance is `net = sum(debit) - sum(credit)`, never the sum of both. Adding debit_amount + credit_amount gives total posting volume, not a balance, and will not tie to the trial balance.

  • mediumReading draft or reversed entries here

    This mart is posted-only by construction. Draft / reversed entries never contribute, so a balance here is the standing posted balance, not work-in-progress.

Questions this answers
  • “What is the net balance of the Accounts Receivable control account this period?”
  • “Which cost centers carry the most expense in FY2025-M12?”
Related metrics
21 of 21
Column
Type
Description
Tests · PII
period_id
UInt64
FK to the fiscal period. Part of the grain.
1 test
period_code
String
Period code (e.g. FY2025-M07). Nullable if the period dimension is missing.
fiscal_year
Int16
Fiscal year of the period. Int16.
period_month
Int16
Calendar month 1..12 of the period. Int16.
period_month_start
Date
Month bucket — toStartOfMonth(period start).
period_status
String
Close status of the period — open / closed / locked.
gl_account_id
UInt64
FK to stg_postgres__gl_accounts.gl_account_id. Part of the grain.
1 test
account_code
String
GL account code (e.g. 4000).
account_name
String
GL account name.
account_type
String
asset / liability / equity / revenue / expense.
account_subtype
Nullable(String)
Finer account classification. Nullable.
normal_balance
String
Side that increases the account — debit / credit.
is_control_account
Bool
True for AR/AP control accounts.
cost_center_id
UInt64
Cost center; 0 when the lines carried none. Part of the grain.
1 test
cost_center_code
String
Cost-center code. Nullable when cost_center_id = 0.
cost_center_name
String
Cost-center display name. Nullable when cost_center_id = 0.
cost_center_region
Nullable(String)
Cost-center region. Nullable.
debit_amount
Decimal(18, 2)
Sum of posted debits in functional USD. Decimal(18,2).
1 test
credit_amount
Decimal(18, 2)
Sum of posted credits in functional USD. Decimal(18,2).
1 test
net_amount
Decimal(18, 2)
The balance — sum(debit) - sum(credit). Decimal(18,2).
1 test
line_count
UInt64
Number of posted lines in the bucket. UInt64.