Sales-cohort analysis · USD
What did you keep?
Revenue, not profit. These exports have no product, marketing or handling costs. Net sales measures the merchandise revenue retained after observed returns.
Gross sales
——
Returned revenue
—Net sales
—Gross less returned revenue
Returned-unit rate
——
01 / Revenue quality
Where returns change the picture
Bars show gross sales split into revenue kept and revenue returned. Sorted by dollars returned. Export includes every matching group.
| Group | Gross | Returned | Net | Unit return rate | Gross → net rank |
|---|
02 / Cohort comparison
Sales month, after returns
Returns follow the original sale, even when the refund occurs later. Newer cohorts have had less time to return.
Read monthly values
| Sale month | Gross USD | Returned USD | Net USD | Unit return rate |
|---|
Try the cohort-maturity example
One June 1 sale: 10 units at $20. Predict the return rate before loading the two dated snapshots. The later file adds a July 5 return to the same June sale.
Reveal the comparison
June 10: 2/10 units returned, 20%, $40 returned and $160 net. July 5: 5/10, 50%, $100 returned and $100 net. The sale and its June cohort did not change; observation time did. Neither snapshot proves final returns are complete.
Which product × channel combinations stand out?
Returned-unit rate and counts for each combination. Select a cell to filter both product and channel. Differences can reflect customer mix and cohort age; they are not causes.
The sale-month filter stays in place.
03 / Audit the join
One row per sale. Every return counted.
Partial returns are added before joining. Sale lines with no return stay in the analysis.
| Line | Sale date | Product | Channel | Sold | Returned | Price USD | Net USD | Raw events |
|---|
Trace one sale through its raw returns
| Return event | Return date | Units |
|---|
File format, calculations and limits
Know the boundaries
The file contract
UTF-8 CSV with these exact headers in any order. Identifiers and labels are trimmed and case-sensitive. Quoted commas and escaped quotes work.
sales.csv
line_id,sale_date,product,channel,units,unit_price_usdOne unique order line. Units: whole number 1–10,000. Unit price: USD 0–10,000, at most two decimals, without a $ sign. Price is the merchandise amount before returns.
returns.csv
return_id,line_id,return_date,unitsOne unique return event linked to a sales line. Multiple events may reference that line. A header-only file means no returns. Returned units cannot exceed units sold.
Dates: real YYYY-MM-DD dates, 2000–2099. A return cannot precede its sale. Labels and IDs: 1–100 characters. No duplicate IDs, extra columns or unmatched returns. Validation errors leave the previous dataset intact.
What this view can—and cannot—tell you
Refunds equal returned units × original unit price. Revenue excludes taxes, shipping, discounts not reflected in price, return fees and costs. This is not profit or refund-month cash flow. Files must cover the same sales universe; no tool can detect returns omitted from an export.
“Observed through” is the latest supplied sale or return date, not proof that returns are complete. All months use returns present in the files. Ranks compare visible groups; ties share a rank. Unit rate = returned units ÷ sold units. A zero denominator is shown as “n/a”. Money is calculated in integer cents; totals show whole USD, unit prices and CSV exports retain cents.