Purpose
The QTY (Quantity) segment specifies a quantity associated with a line item or with the message as a whole. In a purchase order, it states how many units are being ordered. In a despatch advice, it reports how many units were shipped. In an invoice, it records how many units are being billed. The type of quantity is distinguished by a qualifier code, allowing multiple QTY segments to coexist within the same context with different meanings.
The QTY segment can also optionally specify the unit of measure. When the unit of measure is not explicitly stated, trading partners rely on prior agreement or the product master data to determine the applicable unit.
Data Elements
The QTY segment contains one composite data element:
- C186 - Quantity Details:
- 6063 - Quantity Type Code Qualifier: Identifies the type of quantity being specified. Common qualifiers include:
- 21 - Ordered quantity
- 12 - Despatch quantity
- 47 - Invoiced quantity
- 48 - Received quantity
- 46 - Delivered quantity
- 61 - Return quantity
- 192 - Free goods quantity
- 59 - Number of consumer units in the traded unit
- 6060 - Quantity: The numeric quantity value.
- 6411 - Measurement Unit Code (conditional): The unit of measure using UN/ECE Recommendation 20 codes. Common values include:
- PCE - Piece
- KGM - Kilogram
- LTR - Litre
- MTR - Metre
- CT - Carton
- PK - Pack
- 6063 - Quantity Type Code Qualifier: Identifies the type of quantity being specified. Common qualifiers include:
Format and Syntax
The general format of a QTY segment is:
QTY+qualifier:quantity' With a unit of measure specified:
QTY+qualifier:quantity:unitCode' All components belong to the single composite element C186, separated by colons.
Messages That Use QTY
The QTY segment is essential in any message that deals with quantities of goods or services:
- ORDERS - Ordered quantities for each line item
- INVOIC - Invoiced quantities
- DESADV - Despatched (shipped) quantities
- RECADV - Received quantities, discrepancy quantities
- ORDRSP - Confirmed or amended quantities
- INVRPT - Inventory report quantities
Example
An ordered quantity of 48 units:
QTY+21:48' Qualifier 21 means "ordered quantity" and the value is 48. No unit of measure is specified, meaning it is implied by the product definition or trading partner agreement.
A despatched quantity of 250 kilograms:
QTY+12:250:KGM' Qualifier 12 means "despatch quantity," the value is 250, and KGM specifies kilograms as the unit.
Multiple QTY segments for the same line item in a receiving advice:
QTY+48:45'
QTY+21:48' This shows that 45 units were received (qualifier 48) against an ordered quantity of 48 (qualifier 21), indicating a shortage of 3 units.