Crizant InnovationsIntelligent Technology
Book a demo
Engineering Notes

Two clocks: why commission data has to remember when it learned things

A seller moved territory on 1 August and the system heard about it on 14 August. There are now two correct answers to "what was she owed" — and a single-timeline database can only store one of them.

Here is a small, ordinary event. A field seller moves from one territory to another on 1 August. The change is keyed into the system on 14 August. A cycle for the first half of the month closes on the 10th.

Ask the system what she was owed for 1–10 August and there are two correct answers. What did we pay? — computed on the 10th, against the territory the system believed in on the 10th. What should we have paid? — computed against the territory she was actually in. Both are true. They are answers to different questions.

One clock is not enough

Most commission systems store one timeline: the current state of each record, overwritten when it changes, perhaps with an audit log beside it. That is enough to answer the second question roughly and the first question not at all. When the difference surfaces — and in a channel business it always does — it arrives as an adjustment line with no derivation behind it, and someone has to reconstruct by hand what the system believed on the day it paid.

The fix is to keep two clocks on every fact:

ClockRecordsAnswers
Valid timeWhen it was true in the businessWhat should have been paid
Transaction timeWhen the system learned itWhat was paid, and why

Data kept this way is called bitemporal. Schemes, hierarchies, territories, rates and partner status in Crizant One are all stored like this: we keep what was true, and when we learned it.

Nothing is computed in place

Two clocks only help if nothing destroys the history they describe. So in Crizant One nothing is computed in place and nothing is overwritten. A cycle is a pure function of its dated inputs — the scheme version, the hierarchy, the rates and the transactions, each as they stood on the transaction date. Change any input and you get a new, dated fact beside the old one, not a replacement for it.

This is the expensive way to build a commission system, and there is no cheap way to retrofit it. A data model that overwrites cannot later be asked what it used to believe; the information is gone. That is why this is a decision made in the data model — the only place it can be made.

Why an auditor cares

The question an auditor actually asks is not "is the current number right". It is: this amount, to this person, on this date — show the working. With two clocks the answer is a query: select the inputs as the system knew them on that date, run the same pure function, compare. Without them the answer is an investigation.

See the two clocks on a live example on the engineering page, or how Crizant One handles audit.

EngineeringData modelAudit
Book a demo

Bring one of your own schemes.

A thirty-minute session, no commitment. We configure one of your real incentive schemes live and you watch it compute.