SUBTABLE works (I'm suspicous about ROW though)
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 13 Aug 2022 22:44:02 +0000 (15:44 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 13 Aug 2022 22:44:02 +0000 (15:44 -0700)
src/language/stats/ctables.c

index 836a974d824dda2f6f00c7cffa96df4e4b97c559..341e68e0d9039c3b4a7cc5b85aaed688e40614f5 100644 (file)
@@ -4689,6 +4689,17 @@ ctables_prepare_table (struct ctables_table *t)
                       }
                   }
 
+                if (at == CTAT_SUBTABLE && t->label_axis[PIVOT_AXIS_ROW] == PIVOT_AXIS_COLUMN)
+                  {
+                    size_t n_drop = (a == PIVOT_AXIS_LAYER ? 0
+                                     : a == PIVOT_AXIS_ROW ? 2
+                                     : 0);
+                    for (size_t i = 0; i < n_drop; i++)
+                      if (nest->n_areas[at] > 0)
+                        nest->n_areas[at]--;
+                    continue;
+                  }
+
                 bool drop_last = (at == CTAT_SUBTABLE ? a != PIVOT_AXIS_LAYER
                                   : at == CTAT_ROW ? a == PIVOT_AXIS_COLUMN
                                   : at == CTAT_COL ? a == PIVOT_AXIS_ROW