Customer Count

Facts defining customer counts at a given date and value type, used as the baseline for customer evolution.

Facts

Definitions

ColumnDescription
dateDate in YYYY-MM-DD format, reference to Dates.
value_type_idType of value measured (links to Value Types, e.g., actuals, budget).
net_newNet new customers calculated as new customers minus churn, per date and value type.
cum_net_newCumulative sum of net_new.
current_baseNr of customers balance at the beginning of the period.
ending_balanceNr of customers balance at the end of the period.

Sample & Implementation

Customer Count
datevalue_type_idnet_newcum_net_newcurrent_baseending_balance
2025-01-012353530003035
2025-02-012478230353082
2025-03-0124712930823129
2025-04-0124717631293176
2025-05-0124722331763223
2025-06-0124727032233270
2025-07-0124631632703316
2025-08-0124636233163362
2025-09-0124640833623408
2025-10-0124645434083454
CREATE TABLE IF NOT EXISTS customer_count (
    date DATE NOT NULL,
    value_type_id INTEGER NOT NULL,
    net_new INTEGER NOT NULL,
    cum_net_new INTEGER NOT NULL,
    current_base INTEGER NOT NULL,
    ending_balance INTEGER NOT NULL,
    FOREIGN KEY (date) REFERENCES dates(date),
    FOREIGN KEY (value_type_id) REFERENCES value_types(id),
    PRIMARY KEY (date, value_type_id)
)

Data Format

Field

Type

The primary key is formed by constrainst on dates and value types:
PRIMARY KEY (date, value_type)

Dependencies

On this page

Star us on GitHub

If you enjoy this content and find it useful, give us a star on GitHub to show your support and stay updated with our latest improvements.