!!!###!!!title=25.How to automatically calculate and display the aggregate values of the VTable's pivot table?——VisActor/VTable FAQ documents!!!###!!!!!!###!!!description=---title: How to automatically calculate and display the aggregate values of the VTable's pivot table?</br>key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM--- !!!###!!!

Title

How to automatically calculate and display the aggregate values of the VTable's pivot table?

Description

Why is the aggregate node data not displayed after the pivot table is set to display in tree structure?

Solution

Aggregation rules need to be configured so that data can be automatically aggregated during data analysis and the aggregated value can be used as the display value of the parent cell.

Code Example

  dataConfig: {
    totals: {
        row: {
          showSubTotals: true,
          subTotalsDimensions: ['Category'],
          subTotalLabel: 'subtotal'
        }
      }
  },</br>

Results

Online effect reference:https://visactor.io/vtable/demo/table-type/pivot-analysis-table-tree

Tree Table Demo:https://visactor.io/vtable/demo/table-type/pivot-analysis-table-tree
Tutorial on pivot table data analysis:https://visactor.io/vtable/guide/data_analysis/pivot_table_dataAnalysis
Related api:https://visactor.io/vtable/option/PivotTable#dataConfig.totals
github:https://github.com/VisActor/VTable