offdataai
Finance & Accounting · data model template

Accounts Payable Analytics data model

Kimball warehouse for accounts payable: an accumulating-snapshot invoice fact (received → approved → paid milestone date roles, DPO and aging measures) plus a transaction-grain payment fact over conformed vendor/account/cost-center/entity/payment-terms dimensions. Vendor tax IDs and bank account numbers are masked.

Procure-to-pay accounts-payable analytics covering the vendor-invoice lifecycle from receipt through approval to payment, and the resulting disbursements, across a multi-entity, multi-currency ledger. A Kimball star schema with a conformed SCD2 vendor dimension and account, cost-center, legal-entity, and payment-terms dimensions supporting DPO, aging, and early-pay discount-capture analysis. Vendor tax IDs and bank accounts are classified restricted and masked. It is a Kimball dimensional model: fact tables at a declared grain surrounded by conformed dimensions, ready for BI tools and a semantic layer.

KimballFinance & AccountingSOXGAAPGDPR
9
tables
94
columns
11
relationships
3
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: Snowflake). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

invoice_processingdisbursementsconformed_dimensions

Design decisions

  • Accumulating snapshot for the invoice lifecycle

    An AP invoice passes through well-defined milestones (received, approved, due, paid) and we update the same row as it progresses; Kimball's accumulating-snapshot pattern with multiple date-role keys is the canonical fit and yields lag measures like DPO directly.

  • Separate transaction-grain payment fact

    Payments are a distinct business process with their own grain (one disbursement, possibly settling several invoices); modeling them as a separate fact avoids overloading the invoice grain and supports cash-outflow and method-mix reporting.

  • Date-role keys carried as bigint FKs to a single dim_date

    Each milestone (received/approved/due/paid) is a role-playing view of the conformed date dimension; we keep one physical dim_date and one declared relationship, exposing other roles as commented FK columns per the catalog convention.

  • SCD2 on the vendor dimension

    Vendor attributes such as remit-to country, terms eligibility, and diversity classification change over time; type-2 history preserves the as-was vendor profile for accurate period spend and 1099 reporting under SOX.

Tables in the Accounts Payable Analytics model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Fact tables (2)

fct_ap_invoice

Grain: one row per AP invoice (accumulating snapshot: received → approved → paid)

Accumulating snapshot tracking the invoice lifecycle for DPO and discount-capture.

ColumnTypeKeys
ap_invoice_keybigintPK
vendor_keybigint
account_keybigint
cost_center_keybigint
entity_keybigint
payment_terms_keybigint
invoice_date_keybigint
received_date_keybigint
approved_date_keybigint
due_date_keybigint
paid_date_keybigint
invoice_numbervarchar
po_numbervarchar
currencyvarchar
invoice_amountdecimal
tax_amountdecimal
discount_availabledecimal
discount_takendecimal
amount_paiddecimal
amount_outstandingdecimal
days_to_approveinteger
days_payable_outstandinginteger
days_aginginteger
is_disputedboolean
is_paidboolean
is_paid_lateboolean
invoice_statusvarchar

fct_ap_payment

Grain: one row per AP payment disbursement line

Transaction-grain disbursement fact — one row per payment applied to a vendor.

ColumnTypeKeys
ap_payment_keybigintPK
date_keybigint
vendor_keybigint
account_keybigint
entity_keybigint
payment_method_keybigint
payment_idvarchar
invoice_numbervarchar
currencyvarchar
payment_amountdecimal
discount_takendecimal
withholding_amountdecimal
exchange_ratedecimal
payment_statusvarchar
is_early_paymentboolean

Dimension tables (5)

dim_date

Grain: one row per calendar day

ColumnTypeKeys
date_keybigintPK
full_datedateBK
month_numbersmallint
month_namevarchar
quartersmallint
yearsmallint
fiscal_yearsmallint
fiscal_periodsmallint
is_business_dayboolean
is_period_endboolean

dim_vendor

Grain: one row per vendor per SCD2 version

SCD type 2

ColumnTypeKeys
vendor_keybigintPK
vendor_idvarcharBK
vendor_namevarchar
tax_idvarcharPII
vendor_categoryvarchar
vendor_statusvarchar
bank_account_numbervarcharPII
remit_to_countryvarchar
statevarchar
is_1099boolean
is_preferredboolean
diversity_classificationvarchar

dim_account

Grain: one row per GL account per SCD2 version

SCD type 2

ColumnTypeKeys
account_keybigintPK
account_idvarcharBK
account_numbervarchar
account_namevarchar
account_typevarchar
statement_sectionvarchar
is_activeboolean

dim_cost_center

Grain: one row per cost center per SCD2 version

SCD type 2

ColumnTypeKeys
cost_center_keybigintPK
cost_center_idvarcharBK
cost_center_namevarchar
cost_center_typevarchar
manager_namevarcharPII
regionvarchar
parent_cost_center_idvarchar

dim_entity

Grain: one row per legal entity per SCD2 version

SCD type 2

ColumnTypeKeys
entity_keybigintPK
entity_idvarcharBK
entity_namevarchar
entity_typevarchar
countryvarchar
functional_currencyvarchar
tax_jurisdictionvarchar

Lookup tables (2)

dim_payment_terms

Grain: one row per payment-terms code

ColumnTypeKeys
payment_terms_keybigintPK
terms_codevarcharBK
terms_namevarchar
net_due_dayssmallint
discount_percentdecimal
discount_dayssmallint

dim_payment_method

Grain: one row per disbursement method

ColumnTypeKeys
payment_method_keybigintPK
method_codevarcharBK
method_namevarchar

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • fct_ap_invoice.invoice_date_key → dim_date (many-to-one)
  • fct_ap_invoice.vendor_key → dim_vendor (many-to-one)
  • fct_ap_invoice.account_key → dim_account (many-to-one)
  • fct_ap_invoice.cost_center_key → dim_cost_center (many-to-one)
  • fct_ap_invoice.entity_key → dim_entity (many-to-one)
  • fct_ap_invoice.payment_terms_key → dim_payment_terms (many-to-one)
  • fct_ap_payment.date_key → dim_date (many-to-one)
  • fct_ap_payment.vendor_key → dim_vendor (many-to-one)
  • fct_ap_payment.account_key → dim_account (many-to-one)
  • fct_ap_payment.entity_key → dim_entity (many-to-one)
  • fct_ap_payment.payment_method_key → dim_payment_method (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time