Previous Topic: Qualified by RelationNext Topic: Extended by Relation


Examples of Using Qualified by Relations

Example 1: A Qualified File - Product Prices

Your company has a number of products:

FIL Product REF Known by FLD Product code CDE

FIL Product REF Has FLD Product description TXT

Your product prices change from time to time. You may then describe a Product price file as follows:

FIL Product price REF Owned by FIL Product CDE

FIL Product price REF Qualified by FLD Effective date DT#

FIL Product price REF Has FLD Price PRC

Thus for each change of Product price you would have a separate record, a state of affairs represented by the following entries:

Example 2: Using a Qualified File - Product Prices

If you now wish to use the Product price in an Order detail file, you could define an Order file as follows:

FIL Order REF Known by FLD Order number CDE

FIL Order REF Has FLD Order date DT#

FIL Order REF Has FLD Order status STS

FIL Order REF Refers to FIL Customer REF

And, define an Order detail file as follows:

FIL Order detail REF Owned by FLD Order CPT

FIL Order detail REF Known by FLD Order line no NBR

FIL Order detail REF Has FLD Order quantity QTY

FIL Order detail REF Refers to FIL Product price REF

This would result in the following entries:

 

Order detail file

K

K

Order number

Order line no

Order quantity

Product code

Effective date

The fields on the file are the same as if you had used a Known by relation instead of a Qualified by relation for the Effective date. However, additional processing logic is created for the Qualified by relation.

The difference in using a Known by instead of a Qualified by relation is that you will have a code generated that refers to the correct product price. The code is based not on an exact value match of the effective date but on the closest previous value of the effective date.