pivot Data Group Type

The pivot data group type is one of the collection of data manipulation types: filter, group, merged, pivot and relative.

A pivot data group turns a single column of data rows into a single row of data fields.

For example, if you have a table of reference codes where a single client’s references are in the form of a number of rows:

Code
Value
PupilNo
A10237
NHSNo
1798273
CMSId
S0055643

If you wanted to insert these three values into an fDocs generated document other than as a list you would need to create functions to find each, which is more complex than in necessary.

Instead, the pivot data group type lets you turn this data on its side to create a single row with several fields:

PupilNo
NHSNo
CMSId
A10237
1798273
S0055643

You can now use this data group and insert each field as a separate tag in the template.

Data Group SettingsDGT pivot

To create a pivot simply select the new data group’s base from the list of available bases (note: you cannot base a pivot data group on a data manipulation data group), together with the “key” and “value” fields from the base.

The “key” field is the field in the base data group that becomes the field name in the pivot (Code in the example above).

The “value” field is the field in the base that becomes the value field in the pivot (Value in the example above).

Expected Keys

Because the pivot turns data into fields fSeries may not be able to detect which fields are available when it creates its schema (the internal content and layout if each data group) to create tag lists and field selections.

In order to make sure that fSeries knows what field will be available thre are two ways you can inform it.

1. Specify a DSD and data group to gather the list of fields. Field and Name are the fields in the specified DSD that contain the field name and label for the pivot fields.

2. Enter a list of field names in the key list, one per line.

fSeries will combine these two methods and create a list of available fields for the pivot.