gt icon indicating copy to clipboard operation
gt copied to clipboard

Feature Request: Allow Nested Row Groups

Open billdenney opened this issue 5 years ago • 9 comments

Groups of rows in data often are nested, and it would be helpful to have row groups support multi-level nesting. As an example from my work, I generate tables to describe adverse events (side effects) in clinical trials of new medicines. Those tables are grouped by organ system (like neurological) then another level of nesting is the group of symptoms (like brain and peripheral nerves) then the actual event (like headache, hallucinations, tremors, or pain in extremities). In practice, there is more complexity than this (https://en.wikipedia.org/wiki/MedDRA).

It would help if the tables could have this multi-level representation like:

|              Title             |
| Stub         | Col1   | Col2   |
| Group level 1                  |
|    Group level 2               |
|       Row 1  | R1C1   | R2C2   |

billdenney avatar Nov 17 '19 16:11 billdenney

This is of course a good idea. I’ll have to give some serious thought about how to scale up row groups to allow for nesting.

rich-iannone avatar Nov 19 '19 06:11 rich-iannone

I've encountered this problem as well. May I suggest an idea? Concatenate tables. Adapting the previous example, it might be less complicated to simply join two tables

Table 1:
|            Title           |
| Stub     | Col1   | Col2   |
| Group A                    |
|   Row 1  | R1C1   | R2C2   |

Table 2:
|            Title           |
| Stub     | Col1   | Col2   |
| Group B                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |
| Group C                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |

like this:

|            Title           |
| Stub     | Col1   | Col2   |
| Category I                 |
| Group A                    |
|   Row 1  | R1C1   | R2C2   |
| Category II                |
| Group B                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |
| Group C                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |

It would be even better to allow the user to hide a particular level 1 or level 2 headings, to allow for some (poorly conceived) inconsitent table structure:

|            Title           |
| Stub     | Col1   | Col2   |
| Category I                 |
|   Row 1  | R1C1   | R2C2   |
| Category II                |
| Group B                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |
| Group C                    |
|   Row 1  | R1C1   | R2C2   |
|   Row 2  | R1C1   | R2C2   |

nicholaelaw avatar Apr 04 '21 08:04 nicholaelaw

Much needed

pyarasid avatar Jun 28 '22 17:06 pyarasid

Sorry for the delay on this. Agree this is needed and I hope to work on this soon.

rich-iannone avatar Jun 29 '22 00:06 rich-iannone

Just curious where this is. It was one of the first things I looked for when creating clinical tables. The table below I manually created the blanks under the row group values.

nested_row_dimensions

bvarney9 avatar Jun 15 '23 18:06 bvarney9

Just wanted to follow and see if there are any updates on this?

RegalPlatypus avatar Dec 07 '23 18:12 RegalPlatypus

want to follow too

danielfm123 avatar Mar 08 '24 01:03 danielfm123

Would be great to have this

ahasoplakus avatar May 01 '24 10:05 ahasoplakus