> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stockful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Inventory

> Stock levels, valuation and cover per variant and location, live and over any past date range.

Stock levels, valuation and cover per variant and location, live and over any past date range.

This dataset can be read live (as it stands now) or over a past date range (from daily history), and supports `COMPARE TO`.

## Example

```sql theme={null}
FROM inventory
  SHOW current_quantity, previous_quantity
  GROUP BY product
  ORDER BY current_quantity DESC
```

## Metrics

| Metric                       | Type          | Description                                                                                                                                                                                        |
| ---------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `current_quantity`           | Number        | On-hand units at this location.                                                                                                                                                                    |
| `previous_quantity`          | Number        | The variant's total availability on the previous snapshot day.                                                                                                                                     |
| `previous_value`             | Currency      | The variant's cost value on the previous snapshot day.                                                                                                                                             |
| `current_value`              | Currency      | The variant's cost value on the latest snapshot day, paired with the previous one for a change comparison - needs a window spanning both days, so it is not the measure for plain stock valuation. |
| `value_delta`                | Currency      | Cost-value change between the two latest snapshot days.                                                                                                                                            |
| `low_stock_direction`        | Text          | Whether the variant went low on stock or recovered since the previous snapshot.                                                                                                                    |
| `unit_cost`                  | Currency      | Cost per unit; blank when no cost is set.                                                                                                                                                          |
| `price`                      | Currency      | Selling price per unit; blank when no price is set.                                                                                                                                                |
| `compare_at_price`           | Currency      | Compare-at (was) price per unit; blank when not set.                                                                                                                                               |
| `incoming`                   | Number        | Units on incoming transfers or purchase orders to this location.                                                                                                                                   |
| `last_restock_date`          | Date          | Date the variant was last restocked at this location.                                                                                                                                              |
| `incoming_eta`               | Date          | Earliest expected arrival date of the incoming stock at this location.                                                                                                                             |
| `total_quantity`             | Number        | Total on-hand units across the group.                                                                                                                                                              |
| `inventory_value`            | Currency      | On-hand units × cost (and × price), excluding bundle parents.                                                                                                                                      |
| `sku_count`                  | Number        | Distinct tracked variants in the group.                                                                                                                                                            |
| `variants_with_cost`         | Number        | Distinct variants that have a cost set.                                                                                                                                                            |
| `units_sold`                 | Number        | Units sold at this location over the last 30 days (maintained).                                                                                                                                    |
| `units_remaining`            | Number        | On-hand units still available.                                                                                                                                                                     |
| `sell_through_rate`          | Percent       | Units sold over the report's date range as a share of units handled (sold plus still on hand).                                                                                                     |
| `oos_days_30d`               | Number        | Days the variant was out of stock at this location in the last 30 days.                                                                                                                            |
| `lost_units_30d`             | Number        | Estimated units of demand lost to stockouts in the last 30 days.                                                                                                                                   |
| `lost_revenue_30d`           | Currency      | Estimated revenue lost to stockouts in the last 30 days.                                                                                                                                           |
| `days_since_created`         | Number        | Days since the variant was created.                                                                                                                                                                |
| `created_date`               | Date          | Date the variant was created.                                                                                                                                                                      |
| `days_since_last_sale`       | Number        | Days since the variant last sold at this location.                                                                                                                                                 |
| `last_sale_date`             | Date          | Date of the variant's most recent sale.                                                                                                                                                            |
| `days_out_of_stock`          | Number        | Days since the variant was last in stock at this location.                                                                                                                                         |
| `last_in_stock_date`         | Date          | Date the variant was last in stock at this location.                                                                                                                                               |
| `avg_daily_sales`            | Units per day | Average units sold per day (trailing sales velocity).                                                                                                                                              |
| `estimated_lost_revenue`     | Currency      | Estimated revenue lost while out of stock (velocity x days x price).                                                                                                                               |
| `total_skus`                 | Number        | Distinct tracked variants in the group.                                                                                                                                                            |
| `total_value`                | Currency      | On-hand value at cost (and price) for the group. Valued at Shopify's cost-per-item, so it reconciles with Shopify's own reporting.                                                                 |
| `average_velocity`           | Units per day | Average daily sales velocity across the group's variants.                                                                                                                                          |
| `in_stock_percentage`        | Percent       | Share of variants with stock on hand.                                                                                                                                                              |
| `out_of_stock_count`         | Number        | Variants currently out of stock in the group.                                                                                                                                                      |
| `low_stock_count`            | Number        | Variants currently below their low-stock threshold.                                                                                                                                                |
| `daily_velocity`             | Units per day | Units sold per day at this location.                                                                                                                                                               |
| `days_of_cover`              | Number        | Days of stock remaining at the current sales rate; blank when not selling.                                                                                                                         |
| `excess_units`               | Number        | On-hand units beyond the overstock threshold's worth of cover.                                                                                                                                     |
| `cash_tied`                  | Currency      | Cost value of the excess units.                                                                                                                                                                    |
| `current_discount`           | Percent       | Existing markdown vs the compare-at price, if any.                                                                                                                                                 |
| `action`                     | Text          | Markdown, deep markdown or liquidate, by velocity and recency.                                                                                                                                     |
| `days_of_supply`             | Number        | Days the on-hand stock lasts at the current sales rate.                                                                                                                                            |
| `excess_quantity`            | Number        | On-hand units beyond the target days of supply.                                                                                                                                                    |
| `excess_value_cost`          | Currency      | Cost value of the units held beyond 90 days of demand - the overstock only, not the value of all stock on hand.                                                                                    |
| `excess_value_retail`        | Currency      | Retail value of the units held beyond 90 days of demand - the overstock only, not the value of all stock on hand.                                                                                  |
| `inventory_value_landed`     | Currency      | On-hand stock valued at true landed cost, including allocated freight and duties.                                                                                                                  |
| `revenue`                    | Currency      | Revenue over the last 30 days.                                                                                                                                                                     |
| `revenue_percentage`         | Percent       | Share of total revenue.                                                                                                                                                                            |
| `cumulative_percentage`      | Percent       | Running share of revenue, richest first.                                                                                                                                                           |
| `abc_tier`                   | Text          | A (top 80% of revenue), B (next 15%), C (rest), ranked across the groups shown.                                                                                                                    |
| `gmroi`                      | Number        | Annualised gross margin returned per unit of stock at cost. Sales over the report's date range against stock as it stands.                                                                         |
| `inventory_turnover`         | Number        | Annualised cost of goods sold over stock at cost. How many times stock turns per year.                                                                                                             |
| `days_inventory_outstanding` | Number        | Average days stock is held before it sells.                                                                                                                                                        |
| `stock_to_sales`             | Number        | Retail value of stock relative to revenue over the report's date range.                                                                                                                            |
| `weeks_of_cover`             | Number        | Weeks of stock remaining at the current sales rate; blank when not selling.                                                                                                                        |
| `coefficient_of_variation`   | Number        | Average coefficient of variation of daily demand (σ ÷ mean velocity) across the group; higher is more erratic. Blank when there is no in-stock sales signal.                                       |
| `age_days`                   | Number        | Average days the on-hand stock has been in stock since its last restock; blank for out-of-stock items.                                                                                             |
| `reorder_point`              | Number        | Total reorder point across the group. Reorder when available drops to this level.                                                                                                                  |
| `reorder_quantity`           | Number        | Total recommended reorder quantity across the group.                                                                                                                                               |
| `units_to_order`             | Number        | Units still to order once inbound stock and open purchase orders are counted.                                                                                                                      |
| `recommended_spend`          | Currency      | Cost of the units still to order, at the variant's cost price.                                                                                                                                     |
| `safety_stock_units`         | Number        | Total statistical safety-stock units across the group.                                                                                                                                             |
| `demand_std_dev`             | Number        | Average standard deviation of daily demand (units/day) across the group.                                                                                                                           |
| `lead_time_std_dev_days`     | Number        | Average lead-time variability (standard deviation, days) feeding safety stock - higher σ means a larger safety buffer (#506).                                                                      |
| `demand_history_days`        | Number        | Average days of sales history the forecast drew on (up to 365 for backfilled shops) - how much data is behind the numbers (#506).                                                                  |
| `forecast_error`             | Percent       | Weighted average forecast error (WAPE = \|actual − predicted\| ÷ actual) across the group; lower is more accurate.                                                                                 |
| `projected_stockout_date`    | Date          | Soonest projected stockout date across the group at the current sales rate.                                                                                                                        |
| `inventory_margin`           | Currency      | On-hand retail value minus cost value as of the end of the range. Valued at landed cost, so it includes allocated freight and duties.                                                              |
| `avg_units`                  | Number        | Average on-hand units across the group over the range.                                                                                                                                             |
| `peak_units`                 | Number        | Sum of each variant's highest on-hand units over the range.                                                                                                                                        |
| `lowest_units`               | Number        | Sum of each variant's lowest on-hand units over the range.                                                                                                                                         |
| `avg_inventory_value`        | Currency      | Average value held (units × cost, and × price) across the range. The basis for turnover and GMROI over the period.                                                                                 |
| `stockout_days`              | Number        | Total variant-days out of stock across the group over the range (a variant out for 3 days counts 3). Distinct from the live 'Days out of stock' staleness measure.                                 |
| `stockout_events`            | Number        | Times a variant went from in stock to out of stock during the range.                                                                                                                               |
| `lost_sales_units`           | Number        | Estimated units of demand lost while out of stock (days out of stock × velocity).                                                                                                                  |
| `lost_sales_revenue`         | Currency      | Estimated revenue lost while out of stock (lost units × average price).                                                                                                                            |
| `net_units_change`           | Number        | On-hand units at the end of the range minus the start (positive = stock grew).                                                                                                                     |
| `net_value_change`           | Currency      | On-hand cost value at the end of the range minus the start.                                                                                                                                        |
| `units_added`                | Number        | Total day-over-day increases in on-hand units over the range (restocks).                                                                                                                           |
| `units_depleted`             | Number        | Total day-over-day decreases in on-hand units over the range (sales and shrinkage).                                                                                                                |

## Dimensions

| Dimension           | Description                                                                                                                                                                                    |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `product`           | Product with image, rendered as a single cell (variants roll up).                                                                                                                              |
| `sku`               | Variant SKU - splits a product-grain report into variant rows.                                                                                                                                 |
| `variant`           | Variant title (e.g. "Small / Blue"), shown as a dash for products without options. Group by product too - on its own, variants sharing a title across different products fall into one row.    |
| `location`          | Stock location.                                                                                                                                                                                |
| `vendor`            | Product vendor.                                                                                                                                                                                |
| `product_type`      | Shopify product type.                                                                                                                                                                          |
| `category`          | Shopify product category (full taxonomy path).                                                                                                                                                 |
| `location_role`     | Whether the location acts as a hub or a fulfillment location.                                                                                                                                  |
| `country_of_origin` | Variant country of origin (ISO code), grouping under a blank value when none.                                                                                                                  |
| `status`            | Shopify product status (active, draft, archived).                                                                                                                                              |
| `abc_class`         | Maintained ABC tier per variant×location by 30-day revenue, ranked across the whole shop. Distinct from the computed abc\_class measure (variant-grain, in-query); don't select both together. |
| `tags`              | Product tags (the full tag string), grouping under a blank value when none.                                                                                                                    |
| `tag`               | Individual product tag - a SKU appears under each of its tags (cross-tag totals overlap).                                                                                                      |
| `stock_status`      | Maintained stock status (in stock, low, out of stock).                                                                                                                                         |
| `xyz_class`         | Demand-variability tier from CV = σ ÷ velocity: X stable (\<0.5), Y variable (0.5-1), Z erratic (>1); Unclassified when there's no in-stock sales signal.                                      |
| `option_1`          | First variant option as "name: value" (e.g. "Size: M"); blank for products without options.                                                                                                    |
| `option_2`          | Second variant option as "name: value" (e.g. "Color: Red"); blank when absent.                                                                                                                 |
| `option_3`          | Third variant option as "name: value"; blank when absent.                                                                                                                                      |
| `age_bucket`        | Age band of the on-hand stock since its last restock. Unknown when out of stock or the age is unavailable.                                                                                     |
| `incoming_status`   | Whether incoming stock arrives before the projected stockout ('On track'), or after it or not at all with a stockout due ('At risk').                                                          |
| `order_by_week`     | Week the order needs placing, a lead time ahead of the projected stockout.                                                                                                                     |
| `forecast_model`    | The demand model auto-selected per SKU: linear, trend, day-of-week (dow), seasonal, or intermittent (Croston's, for lumpy demand).                                                             |

## Filters

| Filter                     | Type   | Description                                                                                                                |
| -------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| `collection`               | Number | Restrict to products in the selected collection(s).                                                                        |
| `category`                 | Text   | Restrict to products in the selected category (matches sub-categories too).                                                |
| `sales_channel`            | Number | Restrict to products published to the selected sales channel.                                                              |
| `region_catalog`           | Number | Restrict to products in the selected region (market) catalog.                                                              |
| `b2b_catalog`              | Number | Restrict to products in the selected B2B (market) catalog.                                                                 |
| `company_location_catalog` | Number | Restrict to products in the selected company-location catalog.                                                             |
| `vendor`                   | Text   | Product vendor.                                                                                                            |
| `product_type`             | Text   | Shopify product type.                                                                                                      |
| `status`                   | Text   | Shopify product status (active, draft, archived).                                                                          |
| `is_gift_card`             | Text   | Whether the product is a gift card.                                                                                        |
| `published_at`             | Text   | When the product was published to the online store.                                                                        |
| `created_at`               | Text   | When the product was created in Shopify (product age).                                                                     |
| `combined_listing_role`    | Text   | The product's role in a combined listing (PARENT / CHILD / NONE).                                                          |
| `requires_selling_plan`    | Text   | Whether the product can only be bought via a subscription (selling plan).                                                  |
| `country_of_origin`        | Text   | Variant country of origin (ISO code).                                                                                      |
| `province_of_origin`       | Text   | Variant province / state of origin (code).                                                                                 |
| `requires_shipping`        | Text   | Whether the variant is a physical item that ships.                                                                         |
| `weight`                   | Number | Variant weight, in its own unit (see weight\_unit).                                                                        |
| `weight_unit`              | Text   | The unit of the weight value (KILOGRAMS, GRAMS, POUNDS, OUNCES).                                                           |
| `taxable`                  | Text   | Whether tax is charged on the variant.                                                                                     |
| `is_bundle`                | Text   | Whether the variant is a bundle (made up of component products).                                                           |
| `part_of_bundle`           | Text   | Whether the variant is used as a component in any bundle.                                                                  |
| `location_role`            | Text   | Whether the location acts as a hub or a fulfillment location.                                                              |
| `abc_class`                | Text   | Maintained ABC tier (A/B/C) by 30-day revenue.                                                                             |
| `sku`                      | Text   | Variant SKU.                                                                                                               |
| `location_name`            | Text   | Stock location name.                                                                                                       |
| `current_quantity`         | Number | Current on-hand units at the variant × location.                                                                           |
| `velocity`                 | Number | Maintained average units sold per day.                                                                                     |
| `days_of_supply`           | Number | Days of cover at current velocity (on-hand ÷ velocity).                                                                    |
| `lost_revenue_30d`         | Number | Estimated revenue lost to stockouts in the last 30 days.                                                                   |
| `total_revenue_30d`        | Number | Revenue earned in the last 30 days.                                                                                        |
| `total_sold_30d`           | Number | Units sold in the last 30 days.                                                                                            |
| `tags`                     | Text   | Product tag (matches any tag on the product).                                                                              |
| `price`                    | Number | Variant selling price.                                                                                                     |
| `cost`                     | Number | Variant unit cost.                                                                                                         |
| `stock_status`             | Text   | Stock health: healthy, low, out\_of\_stock or overstock.                                                                   |
| `forecast_model`           | Text   | The demand model auto-selected per SKU: linear, trend, dow, seasonal, or intermittent - e.g. filter to your seasonal SKUs. |
| `reorder_point`            | Number | Maintained reorder point, in units.                                                                                        |
| `incoming`                 | Number | Units currently incoming to this location.                                                                                 |
| `snoozed`                  | Text   | Whether the recommendation is currently snoozed.                                                                           |
