Data & evidence

Use point-in-time joins for historical menu and cost data

By Anurag · Published 4 November 2026 · Updated 17 November 2026Global methods · Country rules separately scoped
Constructed learning material. Prepared with AI assistance. Sample businesses, records and outcomes are fictional. External sources support the named methods or scoped facts; they do not validate the sample values as benchmarks.

A restaurant changes an ingredient-cost record today and yesterday's margin dashboard changes with it. Another report keeps its original total but assigns the wrong cost to every order. Both failures can occur when a transaction table is joined to whichever reference row happens to be current. To reproduce a decision, the reporting system needs to know when a reference value applied to the business and when that value became available to the reporting process. Those are different questions.

This laboratory follows the fictional restaurant group Moss Harbour through a four-order cost report. A cost changes prospectively on 6 November. A later correction, recorded on 9 November, changes the earlier period. The exercise reconstructs the report as originally knowable, produces a separately labeled restatement and demonstrates several incorrect joins. Every item, quantity, amount and date is invented teaching material. The example is a management contribution calculation, not an accounting valuation rule, recipe benchmark or determination of tax treatment.

Download the four order records, cost-version history and expected results. The interactive lab switches the information snapshot while keeping the order population fixed. It displays the chosen cost version for each order, not merely the group total. That row-level trace is essential because this fixture includes an incorrect join that happens to reproduce the correct historical aggregate.

TRY THE CASE

Which cost version could this report use?

Fictional inputs and stated model boundaries. The worked calculations and downloadable records below remain available without JavaScript.

Define fixed transaction population, cost scope and information snapshot → Preserve business-effective and knowledge intervals separately → Validate identities, interval boundaries and two-dimensional overlaps → Exclude future-available orders and identify missing cost candidates → Require exactly one eligible cost version per accepted order → Calculate row-level cost and retain selected version identities → Bridge reference corrections separately from late transaction membership → Publish original-information and corrected views with clear labels
  1. Define fixed transaction population, cost scope and information snapshot
  2. Preserve business-effective and knowledge intervals separately
  3. Validate identities, interval boundaries and two-dimensional overlaps
  4. Exclude future-available orders and identify missing cost candidates
  5. Require exactly one eligible cost version per accepted order
  6. Calculate row-level cost and retain selected version identities
  7. Bridge reference corrections separately from late transaction membership
  8. Publish original-information and corrected views with clear labels
Follow the evidence through the decision. Each gate belongs to this constructed case. Download the diagram.

1. Define the reporting question before joining tables

Moss Harbour wants to reproduce a management report prepared after the 8 November trading day. It also wants a later, corrected view using evidence available after 10 November. The first asks what the accepted reference data supported at the earlier reporting snapshot. The second asks how the same order population looks after a verified correction. Both can be useful, but they should not share an unlabeled result that changes whenever someone reruns a query.

The order population contains four accepted orders for one teaching item. Their recorded sales values and quantities are fixed in this exercise. The reference data provide a scoped variable cost per unit. Contribution is the stated sales value less that modeled cost. It does not include every variable expense, fixed overhead or statutory adjustment. Naming this scope prevents a technically correct join from producing a number that readers mistake for complete restaurant profit.

The report specification includes the business period, accepted order population, cost-definition version and information snapshot. It also states whether subsequent corrections should restate earlier periods for this view. Some companies need an original-decision view and a current corrected view side by side. A consistent framework makes both reproducible instead of forcing one to masquerade as the only legitimate version of history.

Start with the decision's information boundary. A correction received on 9 November cannot be used to claim that a manager on 8 November had that knowledge. It may still be appropriate to use the correction in a later restatement. The reporting system should preserve the difference without implying that either the earlier manager or the later analyst acted improperly. The data explain what was available and what changed.

2. Separate business-effective time from knowledge time

Business-effective time describes when the cost applies to the transactions under the chosen contract. Knowledge time describes which version the reporting process had accepted at a given snapshot. A cost can be effective from 1 November while not being confirmed until 9 November. A future price can be known on 1 November but not apply until 6 November. One date column cannot express both relationships reliably.

In this teaching model, each cost row has an effective-from date, an effective-to date, a known-from snapshot date and a known-to snapshot date. The intervals include their lower boundary and exclude their upper boundary. A blank upper bound means no upper boundary is currently declared. Dates represent whole-day reporting periods and closed-day information snapshots, not intraday instants. A production system that needs hour-level decisions must preserve suitable timestamp and time-zone semantics.

The PostgreSQL range documentation explains inclusive and exclusive boundaries and mechanisms for reasoning about overlapping ranges. The exercise adopts an explicit lower-inclusive, upper-exclusive convention. That source supports interval mechanics, not the choice of restaurant cost policy. Whatever storage system a company uses, its join rule should make the boundary visible and test it with an order exactly on the change date.

Knowledge time is not merely the source's claimed effective date typed into another column. It needs an attributable acceptance or availability event. A source can backdate a business-effective correction without making that correction available in the past. Retaining the two dimensions lets the organisation reproduce what it knew while still recording what it later established about the business period.

3. Inspect the four orders and three cost versions

The fictional unit is MU, with 100 integer minor units per MU. Every order sells the same item A at a recorded teaching sales value of 10 MU per unit. The dataset deliberately excludes taxes, discounts, modifiers and other cost components. Those exclusions keep the join exercise auditable; they are not assumptions a real restaurant should silently import into its own margin analysis.

OrderBusiness dateQuantityRecorded sales MUAccepted by snapshot
O13 November101008 November
O25 November202008 November
O36 November101008 November
O48 November202008 November

The order population contains 60 units and 600 MU of recorded sales. Each order identity is unique. All four are accepted by the 8 November closed-day snapshot. The order-availability field is included to prevent an earlier information snapshot from accidentally including an order that the reporting process had not yet received. The interactive comparison uses snapshots late enough to include all four baseline records.

Cost versionEffective periodKnowledge periodCost MU per unit
C11 November through before 6 November31 October through before 9 November4.00
C26 November onward6 November onward5.00
C31 November through before 6 November9 November onward4.50

C3 is a later verified correction to the earlier effective period. It does not replace the prospective 5 MU cost from 6 November. The knowledge period for C1 ends when C3 becomes the accepted earlier-period version. The effective periods for C1 and C3 overlap, but their knowledge periods do not. That distinction is deliberate: the system preserves two historical interpretations without allowing both to match the same order at the same information snapshot.

4. Reproduce the original 8 November report

For each order, find cost rows whose effective period contains its business date and whose knowledge period contains the report snapshot. At the 8 November snapshot, C1 is the eligible earlier-period cost and C2 is the eligible later-period cost. C3 is not yet known. O1 and O2 therefore use 4 MU per unit; O3 and O4 use 5 MU per unit.

O1's modeled cost is 10 × 4 = 40 MU. O2's is 20 × 4 = 80 MU. O3's is 10 × 5 = 50 MU. O4's is 20 × 5 = 100 MU. Total modeled cost is 270 MU. Subtracting it from recorded sales of 600 MU yields scoped contribution of 330 MU. The output should retain the selected version beside every order so a reviewer can reconstruct the sum.

The boundary order O3 occurs on 6 November. Because C1's upper bound is exclusive, O3 does not match C1. Because C2's lower bound is inclusive, it matches C2. If both boundaries were inclusive, the order could match two costs. If both were exclusive, it might match none. This is why interval punctuation becomes a business-reporting issue rather than a minor database detail.

The report release states that it uses the accepted cost information available at the 8 November closed-day snapshot. It does not claim that no later correction will occur. If the company needs to evaluate the manager's original decision, this version provides the relevant evidence boundary. Replacing it silently with a later corrected cost would erase what the original report actually supported.

5. Produce a separately labeled corrected view

At the 10 November snapshot, the effective dates of the orders are unchanged, but the accepted earlier-period cost has changed from C1 to C3. O1 and O2 now use 4.50 MU per unit. O3 and O4 continue to use C2 at 5 MU. The correction applies to the first 30 units, not all 60 units. The later price remains a different effective period.

The corrected costs are 45, 90, 50 and 100 MU. Total modeled cost is 285 MU, and scoped contribution is 315 MU. The change from the original report is 15 MU of additional modeled cost and 15 MU less scoped contribution. The bridge is 30 earlier-period units × 0.50 MU correction = 15 MU. Sales values and quantities do not change in this scenario.

The company can present original and corrected views together: 330 MU contribution based on the earlier information snapshot, and 315 MU using the later accepted correction. These are not contradictory claims if their information boundaries are clear. They answer different questions. The release note should identify the affected cost version and order population instead of saying that the restaurant suddenly became 15 MU less profitable on the day the reference file changed.

Whether a real financial report requires restatement, a prospective change or another treatment depends on the applicable framework and facts. This laboratory does not decide that question. It provides a reproducible management-data bridge and preserves the distinction needed for competent review. A point-in-time data model is an evidence capability, not an automatic accounting-policy engine.

6. See how a current-only join rewrites earlier orders

Suppose the query selects the cost effective at the end of the business period and applies it to every order. The current effective cost is 5 MU, so all 60 units receive that cost. Total modeled cost becomes 300 MU and scoped contribution becomes 300 MU. The query has overwritten the earlier period's different cost without changing any order record.

Compared with the original 8 November view, this overstates cost by 30 MU and understates contribution by 30 MU. Compared with the corrected view, it overstates cost by 15 MU. A chart might look plausible because costs rose during the period, but the join has assigned the rise to transactions before its effective date. The error comes from the measurement rule, not a missing decimal place.

This failure often appears when a reference table stores only one row per item and the historical transaction table contains no cost version or effective-date link. A later update changes every historical join automatically. Keeping a daily exported report may preserve one output, but it does not by itself create a reusable history of reference values. The company needs either reliable versioned reference data or another controlled method that can reproduce the intended historical assignment.

Do not assume the newest effective value is always wrong for every question. A current-cost scenario may intentionally ask what the old sales mix would cost under today's assumptions. That can support pricing or sensitivity analysis if labeled clearly. It should be a separate scenario, not presented as the cost actually assigned under the historical information contract. The difference is the question and label, not a universal prohibition on using current values.

7. Expose the aggregate tie that hides wrong rows

Another query selects the most recently recorded cost row without checking its effective period. At the later snapshot, C3 is the newest recorded row at 4.50 MU. Applied to all 60 units, it produces total cost of 270 MU. That happens to equal the correct original 8 November total. A reviewer checking only the group sum might conclude that the join is right.

It is wrong at every order. O1 and O2 receive 4.50 instead of the original 4.00, overstating their combined cost by 15 MU. O3 and O4 receive 4.50 instead of 5.00, understating their combined cost by 15 MU. The two errors cancel exactly because the fixture has 30 units in each effective period. The matching total conceals a complete failure of row-level temporal assignment.

This is why the expected-answer file includes selected cost-version identities, not only the 270 MU total. Tests should compare O1 and O2 with C1 for the original snapshot and O3 and O4 with C2. For the corrected snapshot, only the first pair changes to C3. A regression check that asserts merely “total cost equals 270” would pass the deliberately wrong latest-recorded join.

The example also shows why “latest” is an unsafe business definition. Latest by effective start, source update time, receiver arrival time and approval time can identify different rows. A company should name the ordering and the purpose. If a query uses a latest-row operation as a performance optimization, it must still implement the complete temporal meaning rather than discard one dimension and hope aggregates remain stable.

8. Detect join multiplication before summing money

If the query checks only business-effective time and ignores knowledge time, O1 and O2 match both C1 and C3. O3 and O4 match C2. The four input orders become six joined rows. Summing sales after that join produces 900 MU because the earlier 300 MU of sales is counted twice. Summing modeled costs produces 405 MU: 120 from C1, 135 from C3 and 150 from C2.

Subtracting those inflated joined totals gives a misleading 495 MU contribution. Another implementation might retain original sales of 600 but subtract the duplicated 405 cost, producing 195 MU. Both are wrong for the intended report. The exact wrong result depends on where aggregation occurs. The underlying defect is the same: the join cardinality no longer represents one chosen cost version per eligible order.

Validate expected cardinality before aggregating. For this contract each accepted order must match exactly one cost row at the selected snapshot. Zero matches is missing reference evidence. More than one match is ambiguity. Neither should be repaired by taking an arbitrary minimum, maximum or first row unless a verified rule specifically establishes why that selection is correct. Silencing the duplicate rows can conceal an overlapping-history defect.

A useful diagnostic table shows order identity, match count and candidate cost-version identities. It directs the owner to a gap or overlap without requiring them to reverse-engineer an inflated group number. The reporting total can be withheld or qualified according to company policy while independent valid rows remain available for investigation. The tool's complete-population output is blocked if any required order lacks an unambiguous assignment.

9. Represent intervals with explicit identity and provenance

A cost-history row needs stable version identity, item identity, monetary unit, unit-cost representation, effective boundaries and knowledge boundaries. The knowledge change should have a source or approval reference. A display label such as “old price” is not enough to distinguish C1 from C3 in an audit. Version identity lets a report state precisely which record supplied its value even if the amount happens to match another record.

Keep source timestamps separate from receiver acceptance timestamps when they represent different facts. A supplier's document may be dated 1 November but reach the reporting team on 9 November. The business-effective correction can point to 1 November while the accepted knowledge interval begins on 9 November. Backdating acceptance to the document's printed date would introduce information into the historical snapshot that the team did not actually possess.

The Microsoft temporal-table overview describes system-versioned history and point-in-time querying for its database products. Its system-managed history is useful evidence about stored row versions. A business-effective period is a separate domain requirement; a company should not assume that enabling system history automatically defines the correct restaurant cost applicability or every external information-availability event.

This lab uses explicit history rows in a portable dataset rather than requiring a specific database. The important property is reproducible meaning, not a vendor feature name. An implementation can use appropriate temporal tables, range structures, controlled snapshots or another tested design. It must still explain how effective and knowledge intervals are created, corrected, bounded and connected to the report's chosen information snapshot.

10. Validate both dimensions before running the join

Every nonempty interval must have an end after its start under this fixture's date convention. A reversed period is invalid. An impossible date is invalid. A missing required lower boundary is not an instruction to use the earliest possible date. A blank upper boundary is allowed only because the contract explicitly defines it as open-ended. Requiredness and open-endedness should not share an ambiguous empty-string interpretation.

Two versions for the same item may overlap in effective time if their knowledge intervals separate the interpretations, as C1 and C3 do. They may also overlap in knowledge time if they apply to disjoint effective periods, as C2 and C3 do. The ambiguous case occurs when both effective and knowledge intervals overlap for the same item and unit. Then an order and snapshot can match both rows. The model rejects that overlapping interpretation rather than accepting join multiplication.

Version identities and order identities must be unique within their declared namespace. Item codes need a stable mapping if different sources reuse them. Quantities must be valid for the chosen unit, and unit-cost arithmetic must preserve the required precision. This fixture uses whole item quantities and integer minor-unit costs. A recipe-cost application with fractional quantities or different precision needs an appropriate exact representation and separately tested rounding policy.

Validate availability too. The order population should not include records accepted after the selected information snapshot when the report claims to reproduce what was knowable then. A fixed historical population can be used for a separate reference-data sensitivity exercise, but it must be labeled as such. The lab reports pending order availability rather than letting future orders silently enter an earlier decision view.

11. Build the point-in-time join calculator

The calculator accepts the fixed orders, cost history and a knowledge snapshot date. It validates records and interval structure, then identifies eligible cost candidates for each available order. The chosen row must satisfy both interval predicates. The output records order identity, quantity, sales, selected version, unit cost, extended cost and scoped contribution. It also returns pending or unmatched orders and a complete-population flag.

For the 8 November snapshot, selected versions are C1, C1, C2 and C2 in order sequence. For the 10 November snapshot, they are C3, C3, C2 and C2. Those assignments are the primary expected answers. Totals are derived from them. If any order has zero or multiple matches, the complete report total is unavailable, while valid row diagnostics can remain visible. This avoids a partial subtotal wearing the label of a complete group result.

The tool separately computes clearly labeled demonstrations of incorrect rules: current-effective cost for all orders, newest-recorded cost for all orders, and effective-only join multiplication. These are teaching counterexamples, not alternative recommendations automatically chosen for a bigger contribution. Their purpose is to show why a number can look reasonable or even tie while the row logic is wrong.

Try adding a new version with the same effective and knowledge intervals as C2 but another cost. The validator should reject the overlap before publishing a total. Remove the earlier-period cost history entirely and the first two orders become unmatched. Change the snapshot to before order acceptance and the model reports a pending population. Each failure has a specific reason and preserves the evidence needed to resolve it.

12. Test corrections without making them invisible

A later correction should identify what it supersedes and the effective period it changes. C3 changes the earlier cost period only. It closes C1's knowledge interval from 9 November and opens its own. It does not erase C1, because C1 remains necessary to reproduce the earlier report. The correction record also needs its evidence and decision attribution outside the small numeric fixture.

If a correction is withdrawn, preserve that event too. The company might reopen an earlier interpretation or issue another accepted version with a new knowledge interval. Simply deleting C3 would make a later report impossible to reproduce and could falsely imply the correction never affected decisions. The maintained history should express the sequence of accepted knowledge, even when the business later concludes that an accepted correction was wrong.

The release bridge identifies affected orders by both item and effective period. A cost correction for 1 through 5 November should not trigger changes to orders from 6 November onward under this contract. An impact query can list the 30 affected units and their 15 MU cost change. A broad “recalculate everything with the newest cost” operation might be easy to run but would reproduce the exact temporal error the guide is designed to prevent.

Retain report versions and distribution records according to the company's process. Updating a dashboard does not necessarily correct an exported spreadsheet, a board memo or a manager's saved screenshot. The owner should decide which earlier outputs need a corrected version and explain the reason. This is a reporting-governance action, distinct from changing the history table correctly inside the database.

13. Use point-in-time data for fair model evaluation

The same join principle matters when testing a forecasting or decision model. A feature that was only corrected on 9 November cannot appear in an 8 November information set without an explicit restated-analysis label. Otherwise the evaluation may benefit from knowledge unavailable to the original process. A model can look more accurate in hindsight while being impossible to operate with the same information at the time.

Feature availability may differ from business validity. A promotion can be effective tomorrow and already known today. A cost correction can be effective last week and only known today. A reservation can be created today for next month, then cancelled later. The data contract should state which time dimension governs each feature and retain the historical version needed at the forecast origin. One generic timestamp field is rarely sufficient for every use.

Evaluation should distinguish original-information performance from revised-data performance. The former asks what could have been achieved operationally; the latter can help diagnose measurement error or estimate a different research quantity. Both can be informative if their scope is clear. Do not combine an original forecast with an actual or feature population that changed definition without showing the bridge. Compatible labels do not guarantee compatible information sets.

The four-order fixture is not a statistical modeling dataset. Its value is the exact failure case: newest-recorded cost produces the right historical total for the wrong reasons. A model pipeline tested only against aggregate totals could pass that defect. Row-level version assertions and future-knowledge mutation tests provide stronger evidence about temporal integrity than a polished score chart alone.

14. Separate managerial scenarios from historical evidence

A restaurant may intentionally ask what past orders would cost under a proposed new recipe or supplier price. That is a valid scenario when quantities, yield assumptions and cost scope are stated. It differs from reproducing the cost information applied to those orders historically. The report should label scenario assumptions directly and preserve the historical assignment as a separate view rather than overwrite it.

The current-effective 5 MU case yields 300 MU modeled cost and 300 MU scoped contribution for the fixed 60-unit mix. It can be called a current-cost scenario. It cannot be called the original 8 November contribution, which is 330 MU under the fixture. The newest-recorded 4.50 case is another scenario, but its effective-period mismatch makes it unsuitable as a historical join. A shared total with the original view does not make the scenario equivalent.

Scenario comparison also needs compatible sales assumptions. If prices, discounts or quantities change in a proposed plan, show those changes separately from the cost-version effect. A 15 MU historical cost correction is not evidence that a proposed price increase will preserve demand or improve profit. The data model can keep the arithmetic transparent while the business remains responsible for obtaining evidence about behavioural and operating consequences.

This distinction helps keep tools simple. The user can choose original-information view, corrected-information view or explicitly hypothetical current-cost scenario. The interface does not need to expose database jargon before showing the main result. It does need plain labels and a visible row trace so a reader understands which question they selected. Simplicity comes from a clear decision model, not from hiding the time dimension that changes the answer.

15. Review the implementation at boundaries and gaps

Check the day before a cost change, the exact change date and the day after. For the fixture, O2 on 5 November uses the earlier effective period, and O3 on 6 November uses C2. Check knowledge snapshots before 9 November and on 9 November. The correction should become available at the declared snapshot boundary. These tests are small and precise, which makes them useful regression fixtures for a larger implementation.

Test a gap deliberately. If C1 and C3 both end their effective period before 5 November, O2 should be unmatched. The receiver should not carry the last value forward automatically unless that is an explicit source and reporting policy. A gap can mean missing evidence, a genuinely unpriced item or a wrong date. An automatic fill would choose one interpretation without review and make the report appear more complete than the data support.

Test a two-dimensional overlap deliberately. A new cost row with C2's effective range and an overlapping knowledge range creates ambiguity even if its amount equals 5 MU. Identical numeric values do not eliminate the identity problem. A future correction might separate them, and duplicated joins may still multiply sales. Reject or resolve the overlapping records using a supported version relationship rather than ignoring the issue because today's totals happen to match.

Finally test independence from future knowledge. Adding a correction whose known-from date is after 8 November must not change the reconstructed 8 November assignments or totals. It may change a later corrected view. This invariant is the central promise of the original-information report. If a new history row changes every old result regardless of its knowledge interval, the system has not implemented the intended point-in-time contract.

16. Hand over the report with a reproducible explanation

The handover pack identifies the four-order snapshot, cost-history snapshot, rule version, information date and output. It includes the per-order selected-version table and the bridge from 270 to 285 MU cost. A reviewer can independently multiply quantities by the chosen costs and verify contribution. They can also inspect the deliberately wrong joins to see why aggregate reconciliation alone would be inadequate.

The data owner confirms the meaning and evidence of the cost versions. The reporting owner confirms the selection rule and output scope. The decision owner confirms which view is appropriate for the intended action. In a small company one person may hold several roles, but the questions should remain distinct. Technical ability to update a table does not establish that every historical report should be restated under the new value.

The final note uses ordinary language: the original report used the cost evidence available after 8 November; a correction accepted on 9 November increased the modeled cost of 30 earlier-period units by 15 MU; later-period units were unchanged. The corrected contribution is 315 rather than 330 MU under the same sales population. This explains the business effect without forcing a manager to decode interval predicates before understanding the result.

Methods, sources and boundaries

Boundary drill: a late order changes population as well as knowledge

Add a fifth fictional order, O5, for ten units sold on 4 November at recorded sales of 100 MU. Assume it is not accepted into the reporting process until the 10 November snapshot. The original 8 November information view must not include it. A later report can include it, but that expanded population is different from the fixed four-order restatement discussed earlier. The company should show both the reference correction and the newly available transaction rather than attributing the combined movement to one cause.

For the fixed four orders, corrected contribution remains 315 MU. O5 adds 100 MU of sales and 45 MU of modeled cost under the corrected earlier-period C3 value, contributing another 55 MU. The expanded later report therefore has 700 MU sales, 330 MU cost and 370 MU scoped contribution. Compared with the original 330 MU contribution, the net increase is 40 MU: positive 55 from the additional accepted order, less 15 from the reference correction to the original population.

A headline saying “contribution improved by 40 MU after the cost correction” would be misleading. The cost correction reduced contribution; the late order more than offset it. A two-part bridge makes those effects understandable. It also prevents someone from claiming that the corrected cost made the business perform better. The reported population and evidence changed, while the actual historical trading events occurred on their original business dates.

The availability filter should use the order's accepted information date under the stated reporting contract. Its business date of 4 November does not make it available to the 8 November decision if the process had not received or accepted it. Conversely, changing the business date to 10 November simply because that is when it arrived would distort the historical trading period. Preserve both dates and let the report's declared question determine how each is used.

The expected-answer file includes this extra-order scenario, and the model test checks both snapshots. At the earlier snapshot it identifies O5 as pending and withholds a complete five-order-population total. At the later snapshot it assigns C3 and reproduces 370 MU contribution. The original fixed-four report remains separately reproducible. This distinction is especially useful when source transactions and reference corrections arrive on different schedules.

Boundary drill: derived cost needs compatible input vintages

Suppose a separate teaching item is purchased in packs. A 20 MU pack originally contains five usable units, giving 4 MU per unit. A later specification contains four usable units for the same pack amount, giving 5 MU per unit. Joining an old 20 MU purchase amount to the current four-unit pack size creates a 5 MU historical unit cost even though the original specification implied 4. Preserving the price history alone would not prevent this error.

A derived reference value therefore needs lineage to all the inputs that determine it: pack amount, usable quantity, conversion basis and any other scoped factor. Those inputs can have different effective and knowledge intervals. The data owner must define which compatible versions form an accepted derived cost. A calculation that combines whichever current row exists in each source can produce a value that never represented any accepted business state.

The company can store an approved derived cost version with references to its component versions, or reconstruct the calculation using a properly designed point-in-time dependency join. Either route needs tests. A reviewer should be able to explain why a particular pack quantity belongs with a particular amount, not merely confirm that division produced a positive value. If usable quantity is unknown or zero, the model should block the unit-cost calculation rather than substitute a convenient default.

This extension is not implemented as a full recipe or purchasing system in the four-order calculator. It identifies the boundary a real implementation must address before reusing the method for derived ingredient costs. The narrow fixture supplies an already accepted unit cost; a production derivation needs evidence for that acceptance. Keeping this boundary visible makes the teaching model easier to adapt responsibly without implying that its simple item join validates every upstream conversion.

All orders, item codes, quantities, amounts, dates and cost histories are original fictional teaching material. Integer minor units preserve the fixture's arithmetic, with 100 minor units per MU. Whole-day effective periods and closed-day knowledge snapshots are explicit simplifications. The model does not establish actual recipe yields, inventory valuation, tax treatment or a statutory restatement requirement. It implements a bounded management-reporting contract.

Primary sources support limited mechanics: PostgreSQL range types for interval boundaries and overlap reasoning, and Microsoft system-versioned temporal tables for stored history and point-in-time querying in its products. The restaurant's two-dimensional policy, fixture, scenario labels and decision workflow are the guide's own design. No vendor endorsement or performance guarantee is implied.

Use the orders CSV, cost-history CSV and answer file to reproduce the complete exercise. When adapting the method, decide both when a value applies and when it was actually available. A trustworthy historical report can explain its row assignments even when a misleading alternative happens to produce the same total.

Research sources and scope

Build on the foundations

These introductory resources are already available in the existing website library.