MultiValued Attributes

To understand how MultiValued attributes are used, let’s look at the structure of an ORDERS database created to capture the data on the sample form in the example below:

MultiValued attributes can be used to describe line items on an order form. The highlighted area in the illustration shown below holds the line items on the printed form in the above illustration. A line item represents information about the purchase of a particular product. The customer might place orders for several different products in different quantities with each one having a different price. The rest of the data fields on this form contain only a single piece of data, such as the customer’s name and address, a credit card number or the amount of the order.

Each order has an order number (outlined in the top right hand corner of the form). This number serves as the item-ID to identify each order in the database file. Each item in the data file has the following sequence of attributes:

CUSTOMER-ID

DATE

PRODUCT

QTY

PAYMENT

SHIP

1

2

3

4

5

6

There are six attributes. Notice that not all the data fields on the form have been used. For instance, there is no AMOUNT or TOTAL-AMOUNT attribute. That is because this information can be derived from data that already exists in the file. The actual data file item storing the data from the order form would look like this:

JSWEN14CRO^7414^X47-180]X47191]Y25340^2]2]1^CASH^UPS

A caret (^) represents an attribute mark. PRODUCT and QTY are MultiValued attributes; that is, each attribute has several pieces of data separated by value marks. A right bracket (]) represents a value mark. In the above example, each MultiValued attribute has three values.

Any group of MultiValued attributes is associated as a unit so that related values are displayed together in INFO/ACCESS reports. In other words, the first value in PRODUCT corresponds to the first value in QTY. This concept is illustrated below.

Remember that a MultiValued attribute is a structure defined by specific delimiters in the data file item. It is not described in the attribute definition in the dictionary. Therefore, it is possible to create an attribute for which some items might have multiple values while others do not. For example, if a person supplied two home phone numbers, both numbers could be placed in the data file item, separated by value marks.

See Also

The Structure of Items

The ORDERS Dictionary

Controlling and Dependent Specifications