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

# Inventory

> Stock at each location: units, value at cost and retail value, today or on any past date, and stock over time.

Stock at each location: units, value at cost and retail value, today or on any past date, and stock over time.

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

## Example

```sql theme={null}
FROM inventory
  SHOW ending_inventory_units, ending_inventory_value
  GROUP BY product_title
  ORDER BY ending_inventory_units DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `ending_inventory_units` | Number | Units on hand at the end of the period (today, for a period ending today). |
| `ending_inventory_value` | Currency | Units on hand times each item's recorded cost, at the end of the period. |
| `ending_inventory_retail_value` | Currency | Units on hand times each variant's price, at the end of the period. |
| `ending_inventory_value_at_historical_cost` | Currency | Units on hand times each item's cost on the last day of the period (today's cost, for a period ending today). |
| `stock_age_days` | Number | Average days since the stock on hand was last restocked, for items in stock. Counts back at most to the start of Queryful's stock history. |
| `available_inventory_units` | Number | Units available to sell now (on hand less committed and unavailable states). |
| `committed_inventory_units` | Number | Units on orders that aren't fulfilled yet. |
| `incoming_inventory_units` | Number | Units on their way to a location (transfers and purchase orders). |
| `starting_inventory_units` | Number | Units on hand on the first day of the period. |
| `inventory_units_net_change` | Number | Ending units minus starting units over the period. |
| `days_in_stock` | Days | Days in the period that ended with stock, summed over items and locations. |
| `days_out_of_stock` | Days | Days in the period that ended with none in stock, summed over items and locations. |
| `inventory_units_sold` | Number | Units ordered in the period, on the days the item had a stock record. Returns aren't taken off. |
| `inventory_units_sold_per_day` | Number | Units sold divided by the days the item had a stock record in the period. |
| `sell_through_rate` | Percent | Units sold as a share of units sold plus ending units. Empty when there was neither. |
| `percent_of_inventory_sold` | Percent | Units sold as a share of starting units. Empty when the period started with none. |
| `days_of_inventory_remaining` | Days | How many days the ending units would last at the period's sales pace. Empty when nothing sold. |
| `stockout_events` | Number | Times an item went from in stock to none at a location during the period. |
| `average_inventory_value` | Currency | Average daily value of the stock held over the period, at each item's cost. |
| `lost_sales_units` | Number | Estimated units that would have sold on the days an item was out of stock everywhere, at the pace it sold while in stock. |
| `lost_sales_revenue` | Currency | Estimated lost sales units times each item's gross sales per unit on the days it had stock. |
| `inventory_turnover` | Number | Cost of goods sold over the period, at a yearly rate, divided by average inventory value. How many times stock turns in a year. |
| `days_inventory_outstanding` | Number | Average days stock is held before it sells: 365 divided by inventory turnover. |
| `gmroi` | Number | Gross profit over the period, at a yearly rate, for each unit of average inventory value. Counts sales with a recorded cost. |
| `stock_to_sales_ratio` | Number | Average stock at retail value divided by net sales over the period. |

## Dimensions

| Dimension | Description |
| - | - |
| `product_title` | Product title (variants and locations roll up). |
| `product_variant_title` | Product variant: splits a product into its variants. |
| `product_variant_sku` | Variant SKU. |
| `product_vendor` | Product vendor. |
| `product_type` | Shopify product type. |
| `product_status` | The product's current status: Active, Archived, Draft, Suspended or Unlisted. |
| `product_tag` | Product tag. A product with several tags counts under each, so totals across tags overlap. |
| `product_collection` | Collection the product is in. A product in several collections counts under each, so totals across collections overlap. |
| `inventory_location_name` | The location holding the stock. |
| `inventory_item_cost` | The item's unit cost saved in Shopify. Empty when none is saved. |
| `inventory_cost_is_recorded` | Whether the item has a cost saved in Shopify. |
| `stock_age` | How long ago the stock on hand was last restocked, in bands. Unknown when the item is out of stock. |
| `product_variant_abc_grade` | A, B or C by the variant's share of gross sales in the period: A variants make up the first 80%, B the next 15%, C the rest and those that didn't sell. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `inventory_item_cost` | Number | The item's unit cost saved in Shopify. Empty when none is saved. |
| `stock_age` | Text | How long ago the stock on hand was last restocked, in bands. Unknown when the item is out of stock. |
| `product_title` | Text | Product title. |
| `product_variant_sku` | Text | Variant SKU. |
| `product_vendor` | Text | Product vendor. |
| `product_type` | Text | Shopify product type. |
| `product_tag` | Text | The product's tags, comma separated. Use contains to match one tag. |
| `product_status` | Text | The product's current status: active, archived, draft, suspended or unlisted. |
| `inventory_location_name` | Text | The location holding the stock. |
| `inventory_is_tracked` | Yes or no | Whether Shopify tracks the item's stock. Untracked items have no stock to report. |
| `inventory_cost_is_recorded` | Yes or no | Whether the item has a cost saved in Shopify. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `product.title`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Product |
| `variant.<field>` | [Variant](https://docs.queryful.app/queryfulql/records/variant.md) | Variant |
| `variant.product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Variant › Product |
| `location.<field>` | [Location](https://docs.queryful.app/queryfulql/records/location.md) | Location |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Inventory adjustments](https://docs.queryful.app/queryfulql/datasets/inventory_adjustment_history.md)
* [Received items](https://docs.queryful.app/queryfulql/datasets/inventory_shipment_received_items.md)
* [Inventory transfers](https://docs.queryful.app/queryfulql/datasets/inventory_transfers.md)
* [Inventory shipments](https://docs.queryful.app/queryfulql/datasets/inventory_shipments.md)
* [Purchase orders](https://docs.queryful.app/queryfulql/datasets/inventory_purchase_orders.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.