add groupby independent of subgraph