Description
Allocate a supplied basket coupon proportionally to one line.
Business metrics depend on event definitions, time windows, revenue and cost bases, and reporting scope. Observed sales during stockout do not by themselves verify latent demand, while a return contribution depends on which costs were already recognized. Local flags and signed balances are not a complete profitability or causal analysis.
Allocate a supplied basket coupon proportionally to one line.
When to use this tool
Use Basket Coupon Prorated Line Discount when you already have lineValue, basketValue, basketCoupon and need to allocate a supplied basket coupon proportionally to one line.
How to use the tool and how it works
- Enter lineValue, basketValue, basketCoupon. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lineDiscount, discountedLineValue. Use the output convention below.
Require basket positive/finite, line within basket and coupon within basket; discount=(line/basket)*coupon, discountedLine=line-discount.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lineValue | Line Value | Required. Finite number; minimum 0. |
| basketValue | Basket Value | Required. Finite number; strictly above 0. |
| basketCoupon | Basket Coupon | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lineDiscount | Line Discount | Required. Finite number. |
| discountedLineValue | Discounted Line Value | Required. Finite number. |
{
"input": {
"lineValue": 30,
"basketValue": 120,
"basketCoupon": 20
},
"output": {
"lineDiscount": 5,
"discountedLineValue": 25
}
} Limitations and assumptions
- No whole-currency rounding or residual allocation is added. Eligibility, disjoint lines, actual coupon, tax and applied price are not verified.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Reconcile source transactions, inventory and cohort records with the full metric definitions. Use complete forecasts, accounting and study designs where needed; individual contributions and supplied scenarios do not establish performance or causal effects.
References
Similar or alternative tools
- Order Line Return Adjusted Margin
Calculate supplied return-adjusted revenue, cost and margin amount.
- Customer Order First Repeat Label
Label a supplied current-order ordinal as first or repeat.