Hi,
you need to preconfigure the groupby node for being able to do this. only after the first configuration you can define the flow variables.
You than can use pattern based aggregation page and add a predefined number of rows. Each row can than be controlled from the outside via flow variables.
As it is a regex, you can also construct a regex which will match multiple columns at once.
i hope this helps to get you started!
Cheers, Iris