Multi-Level RowGroup with multiple levels and data totals
Multi-Level RowGroup with multiple levels and data totals
SaraHillman
Posts: 6Questions: 4Answers: 0
Link to test case: https://docs.google.com/spreadsheets/d/15hoV70NbNDo-sYo07oFeGWPpIK64waT9KbV7zjonDXY/edit?usp=sharing
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: Is it possible to create a table with dynamic nested levels (5-6 levels deep) with data for each level and numerical totals/averages at parent levels. See my sample spreadsheet to show what we are trying to achieve.
Answers
Not really, as that would impact the sorting and filtering. RowGroup supports multi-level groups - please see example here - it might be worth seeing if that could work for you,
Colin
Hi @colin yes sorry that is what I was asking. Would RowGroup support the format I created in the Google Doc example where the nested data goes 5-6 levels deep and there are metrics associated at each parent and child level.
The key to having multiple levels is that the sorting needs to be in the order of the levels. If you have five levels you will define the order using
rowGroup.dataSrc
and useorder
to set the order to match therowGroup.dataSrc
. Just like the example Colin linked.You can use
rowGroup.startRender
orrowGroup.endRender
to perform calculations on the rows within the group. See this example.Kevin
Thank you.
Can the levels in the RowGroup be determined dynamically by the data or does it have to be explicitly defined? The data will have varying levels day-to-day because we ingest the data daily and it can change.
Also each RowGroup in the data might have different levels from other RowGroups. Every RowGroup will at least have one level that can set the initial order.
And every RowGroup will use the same metric that can do the secondary sorting within the RowGroups.
Bikes
Cars
---Cars-fast
--------Cars-fast-00
--------Cars-fast-01
---Cars-slow
--------Cars-slow-00
--------Cars-slow-01
--------Cars-slow-02
-------------Cars-slow-02-AA
Planes
Trains
You can use
rowGroup.enable
to initially enable RowGroup without setting the data source. Sounds like you will want to useinitComplete
to configure the RowGroup. UserowGroup.dataSrc()
to set the data source andorder()
to set the corresponding order.Kevin