Some basic tests.
[pspp] / src / language / stats / ctables.c
index 6b6b46a035239564d3a54c43d353a9bcf06c84f1..edeb97cc28a883e28e44e5b1cda4d2cabaa8bc41 100644 (file)
@@ -2567,12 +2567,16 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t)
     pivot_table_set_caption (
       pt, pivot_value_new_user_text (t->corner, SIZE_MAX));
 
-  bool summary_dimension = t->summary_axis != t->slabels_axis;
+  bool summary_dimension = (t->summary_axis != t->slabels_axis
+                            || (!t->slabels_visible
+                                && t->summary_specs.n > 1));
   if (summary_dimension)
     {
       struct pivot_dimension *d = pivot_dimension_create (
-        pt, t->slabels_axis, N_("Summaries"));
+        pt, t->slabels_axis, N_("Statistics"));
       const struct ctables_summary_spec_set *specs = &t->summary_specs;
+      if (!t->slabels_visible)
+        d->hide_all_labels = true;
       for (size_t i = 0; i < specs->n; i++)
         pivot_category_create_leaf (
           d->root, pivot_value_new_text (specs->specs[i].label));
@@ -2700,7 +2704,7 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t)
                     }
                 }
 
-              if (a == t->slabels_axis && a == t->summary_axis)
+              if (!summary_dimension && a == t->slabels_axis)
                 {
                   levels[n_levels++] = (struct ctables_level) {
                     .type = CTL_SUMMARY,