Pivot Table subtotal of columns

Is it Possible to show Subtotal of column when i collapse collumn in pivot Table?
need to show aggregation of columns when respective column get collpased.
can anyone please guide me how to achieve this.

Hello,

You need to provide specific same-titled operation via addTotalOperation.

https://snippet.webix.com/dt4weiba

Thanks for your Quick response.I understood custom addoperation in pivot,but real expectation is not adding custom operations in values.
let me explain my scenario below also have a requirement of showing subtotal columnwise when collapsing column.

consider below scenario

I have implemented expand/Collapse in column wise in pivot table, where i have gdp as metric and form/country as column Dimension and year as Row dimensions. when i collapse any of columns ,i need to show subtotal of gdp values of all countries under form .

how to achieve this requirement.? can you please help me

Hello,

You can use onColumnGroupCollapse

pivot.$$("data").attachEvent("onColumnGroupCollapse", function(column_id, batch_id, is_opened){
...
})

The third parameter is responsible for collapsing the column (true - opened, false - collapsed)
Inside the event you can create a template function where is possible to add a needed condition. Template does not affect the real data, but you can calculate/render anything you need.

Parameters of Template Function:
obj - each data item
common - common elements declared in type
value - the value of the current cell
col - the column configuration
ind - the index of the current data item

Here you can find information about cells templates: Cells Templates of DataTable, Look and Feel Webix Docs