Conditional group by

I have some variables that I use in the where clause. But I would like to enable/disable something in the groupby. I have tried with variable and values like

none : , host : “host”::tag

But the none gives an error. What is best way to do this?

for now I managed to put it in just one variable

host : “host”::tag, client : “instance”::tag, host+client : “host”::tag, “instance”::tag