[PIVOT_AXIS_COLUMN] = N_("Columns"),
[PIVOT_AXIS_LAYER] = N_("Layers"),
};
- d[a] = (t->axes[a]
+ d[a] = (t->axes[a] || a == t->summary_axis
? pivot_dimension_create (pt, a, names[a])
: NULL);
if (!d[a])
continue;
+ assert (t->axes[a]);
+
struct ctables_freq **sorted = xnmalloc (t->ft.count, sizeof *sorted);
struct ctables_freq *f;
{
struct pivot_category *parent = k > 0 ? groups[k - 1] : top;
+ struct pivot_value *label = pivot_value_new_var_value (
+ va->vars[k], &f->axes[a].values[k]);
+
if (k == va->n - 1)
{
- pivot_category_create_leaf (
- parent,
- pivot_value_new_var_value (va->vars[va->n - 1],
- &f->axes[a].values[va->n - 1]));
+ if (a == t->summary_axis)
+ {
+ parent = pivot_category_create_group__ (parent, label);
+ for (size_t m = 0; m < va->n_summaries; m++)
+ pivot_category_create_leaf (
+ parent, pivot_value_new_text (va->summaries[m].label));
+ }
+ else
+ pivot_category_create_leaf (parent, label);
break;
}
- parent = pivot_category_create_group__ (
- parent,
- pivot_value_new_var_value (va->vars[k], &f->axes[a].values[k]));
+ parent = pivot_category_create_group__ (parent, label);
parent = pivot_category_create_group__ (
parent, pivot_value_new_variable (va->vars[k]));
groups[k] = parent;
-
-#if 0
- for (size_t p = 0; p < ft->n_summaries; p++)
- {
- if (a == t->slabels_position)
- pivot_category_create_leaf (
- c, pivot_value_new_text (ft->summaries[p].label));
- //pivot_table_put1 (pt, leaf, pivot_value_new_number (value));
- }
-#endif
}
}
free (groups);