<flat-file> / <pivot>

A pivot is a special kind of array <field>; think of it as a row that is pivoted on the left and swung down to become a column. A file may contain more than one pivot row.

Flat File Pivot

index

One-based column position of the pivoted array. No two <field>s or <pivot>s can have the same index. If omitted, the system assigns a unique index.

name

Required: Unique name of the pivot array. No two <field>s or <pivot>s can have the same name.

type

Data type of the elements in the pivot array. Valid values are: string, int, long, double, date, duration, and boolean. (Default=string)

format

Used with type="date" pivots to tell the loader how to parse the date string.

nullable

Whether pivot array elements can be null. If nullable="false", the loader treats null values as errors. (Default=true)

default

Value to substitute if a pivot element is null. (Default=null)

default-to-previous-non-null

Whether to use the previous non-null value (from left to right before pivoting, or top-to-bottom after pivoting) if the current value of the pivot element is null. The default applies if there is no non-null previous value. (Default=false)

row

One-based row number that defines the pivot as a fixed pivot. The row attribute is not specified for data pivots, whose element values change from row to row. If you do not specify a row number, the pivot is defined as a data pivot.

relative-row

(For multiple data pivots only) The first instance of the data pivot row relative to the data file’s start-row. For example, if the first data pivot starts on the same row as the start-row, then its relative-row="0"; if the second data pivot starts one row after the first, then its relative-row="1". (Default=0)

columns

Required: Columns in the pivot array specified as one or more comma-separated ranges: col-a:col-b[,col-c:col-d]*. The expression col-a:col-b means from column a to column b. Additional ranges can be specified in the same way, separated by commas. The intention is to omit columns (such as summarization columns) from the pivot.

For example: 2:6,8:12,14:18,20:24 defines a set of four column ranges starting at 2; each range has five columns and skips the column between the ranges. The columns may represent daily production numbers from Monday to Friday, and the skipped columns may represent weekly summarizations.