Takes two parameters, FieldBase, PivotField
The WorkQuery will be transformed such that Records will be swapped as Fields and the Fields will be swapped as Records. The optional PivotField will become the first Field in the Query and remain in place, while the rest of the data is flipped.
If PivotField is not specified, then before the data is flipped a new Field named PivotName will be created and the first Record will have that Field set to PivotValue1, and so on. This allows for access to incoming Fields via simple Named/Value pairs without a fixed requirement ahead of time on which Fields might be arriving.
FieldOne | FieldTwo | FieldThree
D11 | D21 | D31
D12 | D22 | D32
FieldOne | D11 | D12
FieldTwo | D21 | D22
FieldThree | D31 | D32