Multi-Level RowGroup with multiple levels and data totals

Multi-Level RowGroup with multiple levels and data totals

SaraHillmanSaraHillman 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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • SaraHillmanSaraHillman Posts: 6Questions: 4Answers: 0

    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.

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    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 use order to set the order to match the rowGroup.dataSrc. Just like the example Colin linked.

    You can use rowGroup.startRender or rowGroup.endRender to perform calculations on the rows within the group. See this example.

    Kevin

  • SaraHillmanSaraHillman Posts: 6Questions: 4Answers: 0

    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

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    You can use rowGroup.enable to initially enable RowGroup without setting the data source. Sounds like you will want to use initComplete to configure the RowGroup. Use rowGroup.dataSrc() to set the data source and order() to set the corresponding order.

    Kevin

Sign In or Register to comment.