A.5 Simple Data Rules

A.5 Simple Data Rules

The following are examples of rules that apply to a single business object and often only to a single row of data.

Table:

INVENTORY

Description:

Quantity on order cannot be less than minimum-order quantity.

Rule Logic:

MIN_QUANTITY_ORDER <= QUANTITY_ONORDER

  

Table:

INVENTORY_HISTORY

Description:

If number of orders placed is zero, the quantity ordered must also be zero.

Rule Logic:

IF NUM_ORDERS_PLACED = 0 THEN QUANTITY_ORDERED = 0

Table:

SUPPLIERS

Description:

The date a supplier is established must not be later than the last order placed with this supplier. Both dates must not be later than the current date.

Rule Logic:

DATE_ESTABLISHED <= DATE_LAST_ORDER AND
DATE_ESTABLISHED <= CURRENT_DATE AND
DATE_LAST_ORDER <= CURRENT_DATE

Note:

Essentially three rules are put here. One is an object rule and the other two are column rules. It is often easier to put all date-ordering rules into one rule for ease of review and efficiency of execution.

  

Table:

SOURCE

Description:

The order mode must match the ordering information. If the mode is M for mail, an order address must be provided. If the mode is I for Internet, an e-mail address must be provided. If the mode is E for EDI transactions, the EDI communication address must be provided.

Rule Logic:

IF ORDER_MODE = ‘M’ THEN ORDER_ADDRESS != BLANK OR
IF ORDER_MODE = ‘I’ THEN ORDER_EMAIL != BLANK OR
IF ORDER_MODE = ‘E’ THEN EDI_ADDRESS != BLANK

Note:

This rule does not require that columns that do not apply to the mode be blank. Tolerating them is certainly not a quality problem, and keeping them around in case a mode is changed in the future may be helpful. It is up to the business analyst to determine whether they should be blanked out if not appropriate to the mode.

  

Table:

PURCHASE_ORDER

Description:

Various fields have affinities to states. Date shipped and quantity shipped require a status code of shipped, received, or returned. Date received, quantity received, received by, and received by text require a status code of received or returned. Date and quantity returned require a status code of returned. Reason code requires a status code of returned or cancelled.

Rule Logic:

IF STATUS = ‘P’ THEN (DATE_SHIPPED = NULL AND
QUANTITY_SHIPPED=0);
IF (STATUS = ‘P’ OR STATUS =‘S’ OR STATUS=‘C’) THEN
(DATE_RECEIVED = NULL AND DATE_RECEIVED= 0 AND
RECEIVED_BY =BLANK AND RECEIVED_BY_TEXT = BLANK);
IF (STATUS != ‘R’ AND STATUS !=‘X’) THEN REASON = BLANK;

Note:

This is an example of process rules that govern when data is placed in an object.

  



Data Quality(c) The Accuracy Dimension
Data Quality: The Accuracy Dimension (The Morgan Kaufmann Series in Data Management Systems)
ISBN: 1558608915
EAN: 2147483647
Year: 2003
Pages: 133
Authors: Jack E. Olson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net