Skip to main content

pivoting

Pivot​

The pivot function returns a pivoted response of your model data. You can specify the columns, rows, and values to structure the data. The response is a comprehensive object containing all relevant information in a nested structure. The pivot values can be any aggregation type.

const pivotResult = dcupl.fn.pivot({
modelKey: 'Style',
options: {
columns: [{ attribute: 'masterCategory' }],
rows: [{ attribute: 'baseColour' }],
values: [{ attribute: 'year', types: ['min', 'max'] }],
},
});
info

Try it out yourself in the Playground