Hi, it could be very useful to be able to have multiple data fields aggregations inside a single pivot, like you can do in Excel.
To make the column names unique, you can add the data-field name as suffix.
For example:
starting from table <id,warehouse,qty,value> you could obtain one shot the final table shown below instead of all this script: