

# Product lineage
<a name="product_lineage"></a>

*Product lineage* refers to the relationship established between products and their previous versions or alternate products. Demand Planning uses product lineage information to create surrogate histories for these products, which serve as forecast inputs for demand predictions.

Product lineage supports the following patterns:
+ A single product has one lineage or alternate product = 1:1  
![\[Product lineage pattern = 1:1\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/product_lineage_pattern1.png)

  The following example shows an 1:1 scenario.  
![\[Product lineage pattern = 1:1\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/1 is to 1_example.png)
+ A single product has more than one product as lineage or alternate = Many:1  
![\[Product lineage pattern = Many:1\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/product_lineage_pattern2.png)

  Demand Planning supports product lineage relationship modeled as both *chain* or *flattened* methods.
  + **Chain format** – You can directly model lineage relationships like A to B and B to C. In the following example. Demand Planning will model the lineage relationship as A to B, B to C, and A to C.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/product_lineage.html)

    The following example shows an Many:1 scenario - Chain format  
![\[Product lineage pattern = Chain format\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/chain_format.png)
  + **Flattened format** – Demand Planning will continue to support lineage information in A to B and A to C format. In the following example, Demand planning will model the lineage relationship as A to B and A to C. B to C is not considered.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/product_lineage.html)
**Note**  
Chain format only supports 6 levels of lineage relationship. If you have more than 6, you can use flattened format to model the lineage relationship.

  The following example shows an Many:1 scenario - Flattened format  
![\[Product lineage pattern = Flattened format\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/1 is to many_example.png)
+ A single product can be lineage or alternate for more than 1 product = 1 : Many  
![\[Product lineage pattern = 1:Many\]](http://docs.aws.amazon.com/aws-supply-chain/latest/userguide/images/product_lineage_pattern3.png)

To enable the product lineage feature, you can define the lineage relationship for the different versions of the products or alternates/substitutes in the *product\$1alternate* data entity. For more information, see [Demand Planning](required_entities.md).

If your instance was created on or after September 11, 2023, you will see *product\$1alternate* data entity in the AWS Supply Chain data Connection module. If your instance was created before September 11, 2023, create a new data connection to enable the *product\$1alternate* data entity for ingestion.

To ingest data into the *product\$1alternate* data entity, follow the guidelines below:
+ *product\$1id* – The primary product to create the forecast.
+ *alternative\$1product\$1id* – Previous version of the product or alternate/substitute product.

  To consider multiple *alternative\$1product\$1id* for a single *product\$1id*, enter them in separate rows.
+ Demand Planning will consider the data ONLY when the values are provided in the following format.
  + *alternate\$1type* is * similar\$1demand\$1product*.
  + *status* is *active*.
  + *alternate\$1product\$1qty\$1uom* is the text *percentage*.
  + *alternate\$1product\$1qty* – Enter the proportion of history of the alternate product you want to use for forecasting new products in the *alternate\$1product\$1qty* data field. For example, if it is 60%, enter 60. When you have multiple *alternative\$1product\$1id* for a single *product\$1id*, the *alternate\$1product\$1qty* does not have to add up to 100.
+ The *eff\$1start\$1date* and *eff\$1end\$1date* data fields are required. However, you can leave this field empty and Demand Planning will auto-fill with 1000 and 9999 years respectively.

When the forecast is created using product lineage data, you will see an indicator *Forecast is based on alternate product's history* on the Demand Planning page when you filter by *product ID*.

The following table shows an example of how Demand Planning Product lineage feature works based on the data ingested into the *product\$1alternate* data entity.


| Column | Required or Optional | Example 1 | Example 2 | Example 3 | Example 4 | Example 5 | Example 6 | Example 7 | Example 8 | Example 9 | Example 10 | Example 11 | 
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | 
|  product\$1id  | Required | Product 123 | Product 123 | Product 123 | Product 123 | Product 123 | Product 123 | Product 123 | Product 123 | Product 123 | Null | Product 123 | 
|  alternative\$1product\$1id  | Required | Product XYZ | Null | Product XYZ | Product XYZ | Product XYZ | Product XYZ | Product XYZ | Product XYZ | Product XYZ | Null | Product XYZ | 
|  alternate\$1type  | Required | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Null or a different value | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | Similar\$1Demand\$1Product | 
|  status\$1  | Required | active | active | active | inactive | active | active | Null | active | active | active | active | 
|  alternate\$1product\$1qty  | Required | 100 | 60 | 100 | 100 | Null | 100 | 100 | 100 | 100 | 100 | 60 | 
|  alternate\$1product\$1qty\$1uom  | Required | percentage | percentage | percentage | percentage | percentage | Null or a different value | percentage | percentage | percentage | percentage | percentage | 
|  eff\$1start\$1date  | Required | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | Null | 2023-01-01 00:00:00 | 2023-01-01 00:00:00 | Null | 
|  eff\$1end\$1date  | Required | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | 2025-12-31 23:59:59 | Null | 2025-12-31 23:59:59 | Null | 
|  **Expected behavior**  | NA | 100% of product XYZ's history from 1/1/2023 to 31/12/2025 will be used to forecast product 123. | Invalid mapping since alternative\$1product\$1id is missing. | Invalid mapping since alternate \$1type is not 'similar\$1demand\$1product'. | Inactive mapping. | Invalid mapping since alternate\$1product\$1qty is missing. | Invalid mapping since alternate\$1product\$1qty\$1uom is missing or not percentage. | Invalid mapping since status is missing. | Ingestion will fail. | Ingestion will fail. | Invalid mapping since product\$1id and alternative\$1product\$1id are missing. | Ingestion will fail. | 
|    | NA | NA | NA | NA | NA | NA | NA | NA |  Demand Planning will auto-populate the *eff\$1start\$1date* to year 1000. This scenario is valid and data ingestion will not fail. |  Demand Planning will auto-populate the *eff\$1end\$1date* to year 9999. This scenario is valid and ingestion will not fail. | NA |  Demand Planning will auto-populate the *eff\$1start\$1date* to year 1000 and *eff\$1end\$1date* to year 9999. This scenario is valid and ingestion will not fail. | 

The following example explains how Demand Planning will interpret when the *status* is set as *inactive* and the product lineage is in chain format.


| Column | Column | Status | 
| --- | --- | --- | 
|  A  |  B  |  Active  | 
|  B  |  C  |  Inactive  | 
|  C  |  D  |  Active  | 

Demand planing considers the status of the first root and child mapping as the status for the entire chain.

 A to B Active

A to C Active

A to D Active

B to C Inactive

B to D Inactive

C to D Active