Working with multiline records and fields

You can define record or field data that extends beyond one line or one row in a source file. For example:

  • Address data or comment data arranged on multiple lines
  • Different types of data stacked together in a single field
  • Multiline fields with values that vary in the number of lines they contain

The sections that follow explain how to define files with data arranged in this manner.

Multiline records versus multiline fields

In a source file, multiline records contain data on more than one line or row that all belongs to the same record. (See Multiline record with a one-line field and a multiline field.)

The fields in a multiline record may or may not be multiline fields. For example, a two-line record could be a succession of one-line field values that have been wrapped to a second line by the layout of a print image or PDF report.

Multiline fields contain field values that span two or more lines or rows in the source file. For example: addresses that are arranged on multiple lines, or comment fields with text on multiple lines. If a field is multiline, the record containing the field must also be multiline.

Multiline record with a one-line field and a multiline field

The example below shows a three-line record that contains the one-line “Cust No” field and the three-line “Name & Address” field.

Defining a multiline record

You can define a multiline record using either of these methods:

  • Select an initial data value in the first line of a record, and a unique value in the last line of the record.

    In Initial data value in the first line of a record and unique value in the last line, a customer number is selected in the first line, and a zip code is selected in the last line. Defined multiline record shows the resulting multiline record.

  • Define the first line of a record, and then in the Record Definition dialog box, edit the record definition by specifying the appropriate number of lines in the Lines in Record setting. You can use this method when it is not possible to specify a unique value in the last line of the record.

Initial data value in the first line of a record and unique value in the last line

Defined multiline record

Defining fields in a multiline record

You have the following options when defining fields in a multiline record:

  • You can define values that occupy a single line as a single-line field

    In Single-line and multiline fields, the following values are all defined as single-line fields: customer number, city, state, zip code, transaction amount, and limit.

    To define a single-line field, select a single instance of one of the values in the field.

  • You can define values that occupy multiple lines in one of two ways:
    • As multiple fields each containing the data from a single line

      In Single-line and multiline fields, the customer name and street address are defined in this manner.

      To define multiple, single-line fields, select a single instance of the multiline data. By default, Analytics creates a separate field for each line. For each field, an incrementing numeric suffix is added to the field name.

    • As a single field containing the data from all lines

      In Single-line and multiline fields, the comment values are defined as a single field.

      To define a single field containing the data from all lines, select a single instance of the multiline data. In the Field Definition dialog box, under Advanced Options, select Convert to single field.

Single-line and multiline fields

Preview of the fields in the resulting Analytics table

The example below shows how the defined fields in Single-line and multiline fields appear in the resulting Analytics table.

Defining fields that vary in height

You can use the Ends on blank line setting in the Field Definition dialog box to define multiline fields in which the values vary in the number of lines they occupy. The setting specifies that values terminate when they encounter a blank line. This feature only works if one or more blank lines separate each value in the multiline field.

Mismatch between field boundaries and field values

The example below shows the problem that can occur when field values vary in height.

The field height is set to ‘5’ to capture all five lines of the first value in the “Name & Address” field. Because the second value has only three lines, the five-line field height captures too much data, encompassing all of the second value, and the first line of the third value. The result is a mismatch between field boundaries and field values, which also creates mismatched record boundaries.

Field boundaries resized to fit field values

The example below shows how the problem can be solved by selecting Ends on blank line. Now, field and record boundaries dynamically resize to fit the number of lines occupied by each field value.