Profit & Loss

Profit & Loss facts on GL Accounts, defining values per period, value type, and GL account.

Facts

Definitions

ColumnDescription
period_idFactual reference to the period (links to periods).
gl_account_idWhich GL Account (links to gl_accounts).
value_type_idType of value measured (links to value_types, e.g., actuals, budget).
amountFact registered in a currency unit.

Sample & Implementation

A list of PnL' GL Accounts
period_idgl_account_idvalue_type_idamount
11010215000000
21010215194000
31010215448294.23
41010215702878.21
51010215957747.59
61010216212898.14
71010216468325.76
81010216718990.28
91010216969918.37
101010217221106.42
CREATE TABLE IF NOT EXISTS pnl (
    period_id INTEGER NOT NULL,
    gl_account_id INTEGER NOT NULL,
    value_type_id INTEGER NOT NULL,
    amount INTEGER NOT NULL,
    FOREIGN KEY (period_id) REFERENCES periods(id),
    FOREIGN KEY (gl_account_id) REFERENCES gl_accounts(id),
    FOREIGN KEY (value_type_id) REFERENCES value_types(id),
    PRIMARY KEY (period_id, gl_account_id, value_type_id)
)

Data Format

Field

Type

The primary key is formed by constrainst on periods, GL accounts, and value types:
PRIMARY KEY (period_id, gl_account_id, value_type_id)

Dependencies

On this page