Pivot also receives a flat structure and then groups the data according to the defined configuration. The same way flat data can be loaded into the treetable and grouped as you need.
Here’s a related topic. Initially, data can be aggregated through the grouping function.
Current math does not support such features by default, but it’s possible to add custom data aggregation, such as http://webix.com/snippet/685a9367