Inventory by product and size
Store stock by style and size, with broken size runs flagged
- Template
- DOCX
- Export as
- PDF, DOCX, ODT, HTML, PNG +25 more
- Carbone
- 5.0+
Generate size-run stock reports from your merchandising system
Footwear and apparel retailers sell each style in a run of sizes. A style stops selling when its core sizes run out, even with pairs left in the other sizes. Every week, merchandising and store operations teams review the stock of each store by style and size, to transfer pairs between stores, reorder the missing sizes and mark down the slow styles. The merchandising system or the ERP sends the stock and the sales to the Carbone API as JSON, and gets back one PDF report per store.
In this example, Ostervale Footwear, a fictional retailer, reports the men's sneakers of its Boulder store at the close of fiscal week 41: 9 styles in 12 sizes, from US 7 to 13.
In this example, you will:
- Build a crosstab of styles and sizes with a bi-directional loop
- Compute the totals by style and by size, the weeks of supply and the sell-through
- Color the out-of-stock and last-pair sizes
- List the broken size runs with array filters
- Compare the stock of each size with its model stock in a Word chart
What the report measures
| Measure | Definition |
|---|---|
| On hand | Pairs in stock at the close of business, by size |
| Model stock | Planned stock of each size, from the size curve of the category |
| Weeks of supply (WOS) | On hand ÷ average weekly sales of the last 4 weeks |
| Sell-through | Season-to-date sales ÷ season-to-date receipts |
| Broken size run | A style with a core size (9 to 11) out of stock |
| Core sizes in stock | Share of the core sizes in stock, against a target set in the data |
How to build a size-run stock report in Word
The JSON data holds the store and the report facts, the size run with the model stock of each size, and the styles with their sales and the on hand quantity of each size. An excerpt:
{
"report": { "asOf": "2026-11-14", "fiscalWeek": 41, "coreInStockTarget": 95 },
"sizeRun": [ { "size": 7, "modelStock": 9 }, { "size": 7.5, "modelStock": 9 } ],
"styles": [
{
"style": "41120", "color": "014", "name": "Tempo Runner", "colorway": "Graphite / White",
"received": 96, "soldSeason": 74, "sold4w": 22, "onOrder": 36, "onOrderDue": "2026-11-19",
"sizes": [ { "size": 7, "onHand": 3 }, { "size": 7.5, "onHand": 2 } ]
}
]
}
1. Compute the Totals Once
Store the totals with the :set formatter, in the paragraph below the title. These tags print nothing, and the rest of the template reuses their results:
{d.sizeRun[]:set(c.sizes[size=.size])}
{d.styles[].sizes[].onHand:aggSum(.size):set(c.sizes[size=.size].onHand)}
{d.styles[].sizes[].onHand:aggSum:set(c.onHand)}
{d.styles[].sold4w:aggSum:set(c.sold4w)}
{d.styles[].soldSeason:aggSum:set(c.soldSeason)}
{d.styles[].received:aggSum:set(c.received)}
{d.styles[].sizes[size>8.5, size<11.5, onHand>0].onHand:aggCount:set(c.coreIn)}
{d.styles[].sizes[size>8.5, size<11.5].onHand:aggCount:set(c.coreAll)}
{c.coreIn:div(c.coreAll):mul(100):set(c.coreRate)}
{c.onHand:mul(4):div(c.sold4w):set(c.wos)}
{c.soldSeason:div(c.received):mul(100):set(c.sellThru)}- The first tag copies the size run into a new list
c.sizes. - The second adds up the pairs of each size across all the styles: :aggSum(.size) makes one total per size, and the search expression
[size=.size]writes each total next to the model stock of the same size. - The array filters
[size>8.5, size<11.5]select the core sizes, from 9 to 11, to count the core sizes in stock.
2. Display the Header and the Key Figures
Write the report facts with Carbone tags, for example {d.store.number} · {d.store.name} and {d.report.asOf:formatD('ddd, MMM D, YYYY')}, close of business with :formatD.
The five tiles print the stored values: {c.onHand}, {c.sold4w}, {c.wos:formatN(1)}, {c.sellThru:formatN(0)}% and {c.coreRate:formatN(0)}%. The last one turns red below the target of the data, with a condition and a color:
{c.coreRate:ifLT(d.report.coreInStockTarget):show(#B42318):elseShow(#1B2420):color(p)}3. Build the Crosstab with a Bi-directional Loop
Insert a table and repeat the styles in rows and the sizes in columns with a bi-directional loop:
| Style | Colorway | {d.sizeRun[size].size} | {d.sizeRun[size+1].size} | On hand |
| ------------------ | ---------------------- | -------------------------------- | ---------------------------------- | ----------------------------------- |
| {d.styles[i].name} | {d.styles[i].colorway} | {d.styles[i].sizes[size].onHand} | {d.styles[i].sizes[size+1].onHand} | {d.styles[i].sizes[].onHand:aggSum} |
| {d.styles[i+1]} | | | | |
| All styles | | {c.sizes[size].onHand} | {c.sizes[size+1].onHand} | {c.onHand} |
| Model stock | | {c.sizes[size].modelStock} | {c.sizes[size+1].modelStock} | {d.sizeRun[].modelStock:aggSum} |- Rows:
{d.styles[i].name}starts the loop of the styles, and{d.styles[i+1]}ends it. This row prints nothing. - Columns: the iterator of the sizes is named
sizeinstead ofi. Each row repeats its own list of the 12 sizes: the size run in the header, the sizes of the style in the style rows, and the stored totals in the two summary rows. The[size+1]cell sits right after the[size]cell. - Width: set the preferred width of the table to the width of the page, with fixed column widths. The generated table keeps that width with one column per size.
- Totals: :aggSum with empty brackets
sizes[]adds up the sizes of the current style.
The last columns of each style compute the weeks of supply and the sell-through. In the weeks of supply, ..sold4w reads the sales of the style from its list of sizes:
{d.styles[i].sizes[].onHand:aggSum:mul(4):div(..sold4w):formatN(1)}
{d.styles[i].soldSeason:div(.received):mul(100):formatN(0)}%4. Color the Stock Alerts
Add two tags after {d.styles[i].sizes[size].onHand} in the size cell. They color the background and the text of the cell: red when the size is out of stock, amber for the last pair:
{d.styles[i].sizes[size].onHand:ifEQ(0):show(#FDE7E5):ifEQ(1):show(#FEF0D4):elseShow(#FFFFFF):color(cell, background)}
{d.styles[i].sizes[size].onHand:ifEQ(0):show(#B42318):ifEQ(1):show(#8A4B08):elseShow(#1B2420):color(cell, text)}- :ifEQ with :show and :elseShow picks the color, and :color applies it to the current cell.
- Give the text of the cell a font color in the template, so
:color(cell, text)has a color to replace. - Write these tags in a small font: they print nothing, and the column stays narrow in the template.
The header shades the core sizes the same way, with :and:
{d.sizeRun[size].size:ifGT(8.5):and(.size):ifLT(11.5):show(#DCE5E0):elseShow(#F4F6F5):color(cell, background)}5. List the Broken Size Runs
Next to the chart, a second table lists the styles with a core size at zero. It loops over all the styles and removes the rows of the complete runs with :drop(row):
{d.styles[i].sizes[size>8.5, size<11.5, onHand=0].onHand:aggCount:ifEQ(0):drop(row)}The missing sizes are joined with :aggStr: {d.styles[i].sizes[size>8.5, size<11.5, onHand=0].size:aggStr(', ')} prints 9, 10. Below the quantity on order, Due {d.styles[i].onOrderDue:formatD('MMM D')} shows the delivery date, and {d.styles[i].onOrderDue:ifEM:drop(p)} removes the line when nothing is on order.
6. Add the Chart
- Insert a Column chart. Right-click the chart, select Change Chart Type > Combo, and set the second series to a line. Format that line with no line color and dash markers: each marker shows the model stock of a size.
- Right-click the chart, select Edit Data in Excel, and loop on the stored list
c.sizes:
| | On hand | Model stock |
| --------------------- | ----------------------- | --------------------------- |
| {c.sizes[i].size} | {c.sizes[i].onHand} | {c.sizes[i].modelStock} |
| {c.sizes[i+1].size} | {c.sizes[i+1].onHand} | {c.sizes[i+1].modelStock} |- Make sure the chart data range covers these three rows. Carbone adds one column and one marker per size.
Save the DOCX template, connect it to the stock of your merchandising system, and let Carbone generate the size-run stock report of each store.
Related Examples
Check out these similar templates to learn more:
Trusted by 800+ paid customers in 40+ countries














