Skip to content

Systems and records

Multi-stage case dataset sampling: select by start date, keep the endings

By SourceX Editorial · Updated

9 sections

Short answer

In multi-stage case dataset sampling, make the whole episode the unit, from trigger event to terminal event, and select episodes by start date rather than close date or activity in a window. Close-date samples drop cases that never finish; snapshot samples overweight slow ones. Leave follow-up time after the last start date, flag episodes still open at extract or begun before the archive, and publish coverage limits.

System export

Multi stage case dataset

This page covers multi-stage case dataset sampling: select by start date, keep the endings.Illustrative

Key takeaways

  • Sample whole episodes, from trigger to terminal event, never rows or events from separate systems.
  • Start-date cohorts represent cases that began in a period; close-date samples drop unfinished work and snapshots overweight slow cases.
  • Size follow-up time from a mature cohort, and flag censored and left-truncated episodes instead of dropping them.
  • Stratify by path or ending once the episode is the unit, and publish the weights.
  • Report distinct episodes, accounts and observed endings rather than record counts, with a coverage limitations table.

What is the sampling unit in multi-stage case dataset sampling?

The unit is the episode: every stage of one case, from its trigger event to its terminal event, joined across the systems that recorded it. Sample episodes, never rows or events, or the dataset fills up with middles that have no beginning and beginnings that have no end.

A support escalation shows why. One customer problem can open as a Zendesk ticket, move to an engineering issue, trigger a credit in the billing system and reopen two weeks later. A random tenth of all ticket events keeps scattered updates from many cases; a random tenth of episodes keeps whole cases. Zendesk's API documentation describes ticket audits as a read-only history of all updates to a ticket, which is the record needed to rebuild the stages of each one.

The ending is what makes an episode usable. Anthropic's guide to agent evaluation defines the outcome as the final state in the environment at the end of the trial, separate from the transcript, the complete record of the trial. An evaluation or training environment built from business cases needs both the path the work took and the state it reached. OpenAI's GDPval builds tasks from the work of professionals averaging 14 years of experience across 44 occupations and grades finished work products such as a legal brief or a nursing care plan. A multi-stage case rarely ends in one deliverable; it ends in a state reached after several hands, which is why its last stage cannot be sampled away.

Three selection clocks, three different samples

Every case sample is selected on a clock, and the clock decides which endings you see. Start date, close date and activity in a window each pick a different population out of the same archive.

Selecting by start date takes every episode whose trigger falls inside an entry window and follows it to the extract date. It represents the cases that began in that period, including those not yet finished, which then need a censoring flag. Selecting by close date keeps only episodes that reached a terminal event, so cases that were abandoned, are still open or were never formally closed vanish instead of being counted as unfinished. The common variant that requires a case to open and close inside the same window also removes every case longer than the window.

Selecting by activity in a window, or by a snapshot of everything open on one day, overweights slow cases, because a long case is open on more days and so is more likely to be caught. Survival researchers call this length bias: Huang and Qin, analyzing a prevalent cohort of people with dementia, describe a design whose sampling favors those who survive longer. A snapshot of an open claims queue has the same shape. The table compares the clocks:

Three selection clocks, three different samples
ClockWhich episodes enterTypical distortionUse it when
Start date (entry cohort)Trigger event inside the entry windowRecent starts are unfinished at extract and need censoring flagsYou need rates, durations or outcome mix for cases that began in a period
Close date (exit cohort)Terminal event inside the windowCases that never close disappear; open-and-close filters cut every long caseYou need only examples of finished paths and say so
Activity in window or snapshotAny episode open during the window or on one dateLength bias: slow cases are overrepresentedYou are studying the workload open at one time, not case outcomes
Undocumented export queryWhatever the query happened to returnUnknown, and impossible to correct afterwardNever; reconstruct the query first

Illustrative: one archive, three clocks

The same archive yields three different datasets depending on the clock, and the differences fall exactly on the cases a model most needs to see end. Take an illustrative escalation archive in which most cases close within 30 days but about one in ten runs past 90 days, usually because it went to engineering or to a refund dispute.

A sample of cases opened and closed inside one 60-day window contains none of the long cases, so a model trained on it never sees an engineering handoff resolve. A snapshot of everything open on one day is the reverse: long cases pile up in any open queue, so they crowd out the routine ones and make the typical case look slow and contested.

A start-date cohort of cases opened in the same 60 days, followed for 120 days afterward, contains long cases at their real share. The few still open at the extract carry a censoring flag and their observed duration instead of a made-up ending. Only this third sample can support a claim about how often escalations end in a refund, and only if it also says how many endings were not yet observed.

How much follow-up time does a start-date sample need?

Leave a follow-up period between the last start date and the extract date long enough that most episodes in an older, mature cohort had reached their ending. Measure that period from history, stage by stage, rather than guessing it.

A workable rule: take a cohort that started long enough ago to be essentially complete, find the time by which a stated share of its episodes reached a terminal event, and use that as the minimum follow-up. Publish the share you chose. Episodes still open at the extract date are right-censored. Like units still running at the end of a reliability test in NIST's engineering statistics handbook, they are known only to have lasted at least as long as they were observed.

Censored episodes still carry information. In the handbook's exponential model, the failure-rate estimate divides the number of failures by the total unit test time, including the hours logged by units that never failed. Dropping open cases, or labeling them failures, discards that exposure time and biases every duration. How to label such cases is covered in the companion page on unresolved case censoring; the sampling job is to keep them in the frame with their observed duration.

Left truncation is the mirror problem. An episode that began before the archive's first date arrives with its early stages missing. Exclude such episodes from a start-date cohort, or keep them with a flag and never use them for duration or path statistics.

Stratify by path and ending, not by stage table

When some paths are rare, stratify after the episode is the unit: draw whole episodes within strata defined by path or terminal state, and keep the weights. Drawing separate quotas from separate stage tables produces fragments that cannot be joined back into cases.

Typical strata for a service workflow are resolved at first contact, escalated and resolved, reopened, abandoned or withdrawn, and still open at extract. Oversample the rare strata if the task needs them, record each stratum's population count and sampling fraction, and publish the weights so that anyone estimating a rate can undo the oversampling.

Joining stages across systems is where endings most often get lost. Map the case key in each system before sampling, for example ticket ID to engineering issue key to credit memo number, and count how many episodes break at each join. Check the export route as well: Zendesk's documentation notes that its endpoint for listing all audits skips archived tickets, so a sample pulled that way can silently lose a whole class of cases. Find out what the account archives and fetch those tickets one at a time.

Decide what a reopen is before counting anything. If a case reopened within a set number of days counts as the same episode, its ending moves later; if it counts as a new episode, the first one ended at its original close. Either rule works if it is written down and applied in every system. Exporting the finished sample as an event log in a published format, such as the IEEE 1849-2023 XES standard for event logs and event streams, keeps stages, timestamps and case keys together for whoever audits it next.

The multi-stage case sampling worksheet

Fill in the worksheet before the first query runs, so the selection rule is fixed before anyone sees which cases it picks. Each row records one decision and the check that proves the extract followed it.

The figure applies the start-date rule to five illustrative episodes in an archive that starts when the entry window opens: one began before the archive starts and is left-truncated, two started inside the window and have an observed ending, one is still open at the extract date and is censored, and one started after the window and falls outside the cohort.

The illustrative column below uses a support escalation workflow; replace it with your own systems and dates:

The multi-stage case sampling worksheet
FieldDecision to recordIllustrative entry: support escalationsCheck before sampling
Sampling unitWhat one episode is, from trigger to terminal eventOne customer problem, from first ticket to final close or creditEvery record maps to exactly one episode
Trigger eventThe event that starts an episodeFirst ticket created for the problemA trigger timestamp exists for every episode
Terminal eventsEvery state that ends an episodeSolved with no reopen within 14 days, credit issued, or withdrawnEach terminal state comes from a named source field
Selection clockStart date, close date or snapshot, and whyStart dateThe export query matches the stated clock
Entry window and extract dateFirst and last start dates, and the extract dateStarts January to June 2025; extract on March 31, 2026Follow-up covers the chosen share of a mature cohort
Censoring and truncation flagsHow unfinished and partial episodes are markedOpen at extract: censored, with days observed; started before archive: truncatedNo unfinished episode is labeled a failure
Strata and weightsPath or ending strata, population counts and sampling fractionsFive ending strata, with reopened cases oversampledWeights recover population shares
Cross-system keysKey map and join loss per systemTicket ID to issue key to credit memo numberBroken joins are counted, not silently dropped
A timeline of five illustrative episodes against an archive start, an entry window, a follow-up period and an extract date, marking one left-truncated, two with observed endings, one censored and one outside the cohort.
The start-date rule on five illustrative episodes; positions are examples, not measured data.

Can a large record count make up for a weak selection rule?

No. Record counts measure rows, while the questions a sample can answer depend on distinct episodes, distinct customers and observed endings. A million events can hold a few thousand episodes, dominated by a handful of accounts, with most recent ones still open.

Test that alternative directly. Before claiming coverage, report five numbers: distinct episodes, distinct accounts or sites, the largest share contributed by a single account, the share with an observed terminal event and the share censored or truncated. If a few accounts dominate, treat the account as a cluster and size the sample in accounts as well as episodes.

Unobserved failures are the last gap. Work abandoned by phone, settled by email outside the system or deleted under a retention rule never becomes an episode, so no clock can select it. Size those exits from an independent count, such as call logs or billing records, before saying what the sample represents.

Coverage limitations table: what the sample can and cannot claim

State the limits in a table that travels with the dataset, so a buyer can read what was not observed as easily as what was. A limitation stated up front narrows a claim; one discovered in acceptance testing usually sinks it.

Each row names a limitation, how it shows up, the claim that survives and the evidence that would remove the limit:

Coverage limitations table: what the sample can and cannot claim
LimitationHow it shows upClaim that still holdsEvidence that would close it
Right-censored recent startsOpen episodes at extract, concentrated in late start monthsPath and duration statistics for mature startsA second extract after more follow-up
Left-truncated early episodesEpisodes missing their trigger or early stagesLater-stage behavior only, flagged as suchAn archive pull that reaches further back
Never-logged exitsShortfalls against call, email or billing countsCases that entered the system of recordMatched counts from an independent source
Reopen ruleEndings shift under a different reopen windowResults under the stated ruleA sensitivity run at a second window
Cross-system join lossEpisodes that stop at a system boundaryPaths inside fully joined systemsA repaired key map
Process change mid-windowStage durations jump at a policy or tool changeSeparate estimates before and after the changeThe change date and scope from the system owner

Writing the selection rule into a data request

Put the clock, the window and the flags in the request itself, so a supplier's extract can be checked against them. A request that only asks for a number of cases invites a close-date export of finished work.

SourceX holds no stock of datasets: it sources them from U.S. businesses when an AI buyer asks, and its request form collects the buyer's scope, volume, language, format, timing and licensing needs. For multi-stage cases, add the episode definition, the selection clock, the entry window and extract date, the minimum follow-up, the censoring and truncation flags you expect and the acceptance test you will run on delivery.

Whether a given supplier's records can meet that specification is assessed request by request. This page describes a method, not an available dataset, and it reports no SourceX sampling results.

Frequently asked questions

Why not take a random sample of rows from each system?

Rows from different systems rarely line up into whole cases. A row sample keeps fragments of many episodes, loses the terminal stage for most of them and cannot be joined back reliably. Sample episodes first, then pull every row that belongs to each one.

Is sampling by close date ever acceptable?

Yes, when the task needs only examples of finished paths and the dataset says that unfinished cases were excluded. It is not acceptable for rates, durations or outcome shares, because cases that never close are missing rather than counted as open.

What is length bias in a case sample?

Length bias is the overrepresentation of long-running cases in any sample taken from what is open at a point or during a window. Long cases are open on more days, so they are more likely to be caught, and averages computed from such a sample overstate typical duration.

How should reopened cases be counted?

Choose a rule before sampling: either a reopen within a set number of days continues the same episode, or every reopen starts a new one. Apply it in every system, record it in the dataset documentation and rerun key statistics under a second window to show how sensitive they are.

Can unfinished cases stay in a training or evaluation set?

Yes, if each one carries a censoring flag and its observed duration. They should never be scored as failures. For outcome-graded evaluation, use only episodes old enough to have matured, or a metric designed for censored outcomes.

Sources

  • Zendesk describes ticket audits as a read-only history of all updates to a ticket and notes that the list-all audits endpoint skips archived tickets. Source
  • Anthropic defines the outcome as the final state in the environment at the end of a trial and the transcript as the complete record of a trial. Source
  • GDPval covers 44 occupations with tasks drawn from professionals averaging 14 years of experience and asks for real work products. Source
  • NIST's engineering statistics handbook describes censored data: units still running at the end of a test are known only to have lasted the test time. Source
  • NIST's handbook gives the exponential-model failure-rate estimate as failures divided by total unit test time, including units that did not fail. Source
  • Huang and Qin (2012) analyze a prevalent cohort of people with dementia whose sampling favors individuals who survive longer, producing length-biased survival times. Source
  • IEEE 1849-2023, the eXtensible Event Stream (XES) standard, defines a format for event logs and event streams. Source

Tell us what data you need

Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.

See if your company qualifies