The Pivot Table node in Analyze is typically used to aggregate a measure using two specified dimensions. You can specify the same field for both measures.

This would result in the following output using your test data for the sum of the PRICE field:

As only one measure column can be aggregated within a Pivot Table node, you would need to use a second node to aggregate the other measure and then merge the two sets of results data (using a Lookup or Join node):

Which would result in the following:

Alternatively, you could use an Aggregate node to sum both measure fields with the GroupBy fields set to the ID field:

Which would result in:

A second Aggregate would need to be configured to generate the grand total values. This node would not have the GroupBy fields property set:

Resulting in the following:

As the aggregation did not include a GroupBy term, a Calculate Fields node could be used to create the required value of the 'ID' field ( = "Grand Total")


The two sets of aggregated data can then be combined using a Cat node:


Note, the above requires the ID field to be a string type rather than a numeric type.
You could also consider using the 'FRUIT' field as the GroupBy field rather than the 'ID' field, since this would provide more information on meaning of the sub-totals.

See the attached example data flow.
Attached files
Pivot_Table_Fruit_342 - 14 Jan 2020.lna